mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Get rid of passing a reference
Fixes https://github.com/owncloud/core/issues/14643
This commit is contained in:
parent
d6276faff6
commit
70c228a7cc
1 changed files with 6 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue