Use filter_var for function url_escape($input).
This commit is contained in:
parent
a82f9382d1
commit
372f4fad7c
@ -34,14 +34,18 @@ function int_escape($input) {
|
|||||||
* @retval string
|
* @retval string
|
||||||
*/
|
*/
|
||||||
function url_escape($input) {
|
function url_escape($input) {
|
||||||
if(is_null($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 */
|
||||||
|
return filter_var(idn_to_ascii($input), FILTER_SANITIZE_URL);
|
||||||
|
|
||||||
|
/*if(is_null($input)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
$input = str_replace('^', '^^', $input);
|
$input = str_replace('^', '^^', $input);
|
||||||
$input = str_replace('/', '^s', $input);
|
$input = str_replace('/', '^s', $input);
|
||||||
$input = str_replace('\\', '^b', $input);
|
$input = str_replace('\\', '^b', $input);
|
||||||
$input = rawurlencode($input);
|
$input = rawurlencode($input);
|
||||||
return $input;
|
return $input;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -210,6 +214,7 @@ function show_ip($ip, $ban_reason) {
|
|||||||
* will try and standardise them
|
* will try and standardise them
|
||||||
*/
|
*/
|
||||||
function undb_bool($val) {
|
function undb_bool($val) {
|
||||||
|
// Could this be combined with bool_escape() ?
|
||||||
if($val === true || $val == 'Y' || $val == 'y' || $val == 'T' || $val == 't' || $val === 1) return true;
|
if($val === true || $val == 'Y' || $val == 'y' || $val == 'T' || $val == 't' || $val === 1) return true;
|
||||||
if($val === false || $val == 'N' || $val == 'n' || $val == 'F' || $val == 'f' || $val === 0) return false;
|
if($val === false || $val == 'N' || $val == 'n' || $val == 'F' || $val == 'f' || $val === 0) return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user