diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-12-08 08:27:52 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-12-08 08:56:46 +0100 |
commit | 70c228a7cc31c6193bdd1c2f18a75dffe08785b8 (patch) | |
tree | ecd9a27a3ba00da595d47bdf58e26b447103cfe8 /lib/private/util.php | |
parent | d6276faff6fafe88f59953cb61f9411038be23e9 (diff) | |
download | nextcloud-server-70c228a7cc31c6193bdd1c2f18a75dffe08785b8.tar.gz nextcloud-server-70c228a7cc31c6193bdd1c2f18a75dffe08785b8.zip |
Get rid of passing a reference
Fixes https://github.com/owncloud/core/issues/14643
Diffstat (limited to 'lib/private/util.php')
-rw-r--r-- | lib/private/util.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/util.php b/lib/private/util.php index c31ad63b9be..eb188b649e8 100644 --- a/lib/private/util.php +++ b/lib/private/util.php @@ -1177,14 +1177,16 @@ class OC_Util { * This function is used to sanitize HTML and should be applied on any * string or array of strings before displaying it on a web page. * - * @param string|array &$value + * @param string|array $value * @return string|array an array of sanitized strings or a single sanitized string, depends on the input parameter. */ - public static function sanitizeHTML(&$value) { + public static function sanitizeHTML($value) { if (is_array($value)) { - array_walk_recursive($value, 'OC_Util::sanitizeHTML'); + $value = array_map(function($value) { + return self::sanitizeHTML($value); + }, $value); } else { - //Specify encoding for PHP<5.4 + // Specify encoding for PHP<5.4 $value = htmlspecialchars((string)$value, ENT_QUOTES, 'UTF-8'); } return $value; |