The idn_to_ascii() function is only supported by PHP version 5.3 and up.
This commit is contained in:
parent
a0a0ba5bbc
commit
a79875c1eb
1 changed files with 11 additions and 5 deletions
|
@ -35,8 +35,14 @@ function int_escape($input) {
|
|||
*/
|
||||
function url_escape($input) {
|
||||
/* The function idn_to_ascii is used to support Unicode domains / URLs as well.
|
||||
See here for more: http://php.net/manual/en/function.filter-var.php */
|
||||
See here for more: http://php.net/manual/en/function.filter-var.php
|
||||
However, it is only supported by PHP version 5.3 and up
|
||||
*/
|
||||
if (function_exists('idn_to_ascii')) {
|
||||
return filter_var(idn_to_ascii($input), FILTER_SANITIZE_URL);
|
||||
} else {
|
||||
return filter_var($input, FILTER_SANITIZE_URL);
|
||||
}
|
||||
|
||||
/*if(is_null($input)) {
|
||||
return "";
|
||||
|
@ -71,8 +77,8 @@ function bool_escape($input) {
|
|||
Yay for Got'chas!
|
||||
http://php.net/manual/en/filter.filters.validate.php
|
||||
*/
|
||||
if (is_bool($value)) {
|
||||
return $value;
|
||||
if (is_bool($input)) {
|
||||
return $input;
|
||||
} else {
|
||||
$value = filter_var($input, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
|
||||
if (!is_null($value)) {
|
||||
|
|
Reference in a new issue