]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't walk objects with array_walk_recursive()
authorThomas Tanghus <thomas@tanghus.net>
Thu, 21 Feb 2013 23:51:54 +0000 (00:51 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Thu, 21 Feb 2013 23:51:54 +0000 (00:51 +0100)
lib/util.php

index ab47e404c9703ca27ca46a56463a2a172ae902f9..53a30cfc1bb0bf8d42fa531f3510613f7a597162 100755 (executable)
@@ -504,10 +504,10 @@ class OC_Util {
         * @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;
        }