Get rid of passing a reference

Fixes https://github.com/owncloud/core/issues/14643
This commit is contained in:
Lukas Reschke 2015-12-08 08:27:52 +01:00
parent d6276faff6
commit 70c228a7cc

View file

@ -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;