From 70c228a7cc31c6193bdd1c2f18a75dffe08785b8 Mon Sep 17 00:00:00 2001 From: Lukas Reschke <lukas@owncloud.com> Date: Tue, 8 Dec 2015 08:27:52 +0100 Subject: [PATCH] Get rid of passing a reference Fixes https://github.com/owncloud/core/issues/14643 --- lib/private/util.php | 10 ++++++---- 1 file 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; -- GitLab