Merge pull request #1839 from owncloud/no_recursive_object_walking

Don't walk objects with array_walk_recursive()
This commit is contained in:
Lukas Reschke 2013-02-25 12:53:23 -08:00
commit a2a1e8c2cb
1 changed files with 2 additions and 2 deletions

View File

@ -496,10 +496,10 @@ class OC_Util {
* @return array with sanitized strings or a single sanitized string, depends on the input parameter.
*/
public static function sanitizeHTML( &$value ) {
if (is_array($value) || is_object($value)) {
if (is_array($value)) {
array_walk_recursive($value, 'OC_Util::sanitizeHTML');
} else {
$value = htmlentities($value, ENT_QUOTES, 'UTF-8'); //Specify encoding for PHP<5.4
$value = htmlentities((string)$value, ENT_QUOTES, 'UTF-8'); //Specify encoding for PHP<5.4
}
return $value;
}