forked from Wavyzz/dolibarr
Update functions.lib.php
This commit is contained in:
@@ -659,11 +659,11 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options =
|
|||||||
break;
|
break;
|
||||||
case 'alpha': // No html and no " and no ../
|
case 'alpha': // No html and no " and no ../
|
||||||
case 'alphanohtml': // Recommended for most scalar parameters and search parameters
|
case 'alphanohtml': // Recommended for most scalar parameters and search parameters
|
||||||
if (!is_array($out))
|
if (!is_array($out)) {
|
||||||
{
|
|
||||||
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
|
||||||
// '../' is dangerous because it allows dir transversals
|
// '../' is dangerous because it allows dir transversals
|
||||||
$out = str_replace(array('"', '"', '../'), '', trim($out));
|
$out = str_replace(array('"', '"', '../'), '', trim($out));
|
||||||
|
// keep lines feed
|
||||||
$out = dol_string_nohtmltag($out, 0);
|
$out = dol_string_nohtmltag($out, 0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user