Skip to content

Commit

Permalink
Merge pull request #1839 from owncloud/no_recursive_object_walking
Browse files Browse the repository at this point in the history
Don't walk objects with array_walk_recursive()
  • Loading branch information
LukasReschke committed Feb 25, 2013
2 parents 6dd1d47 + efe33c5 commit a2a1e8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,10 +496,10 @@ public static function callCheck() {
* @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;
}
Expand Down

0 comments on commit a2a1e8c

Please sign in to comment.