From: Lukas Reschke Date: Mon, 11 Jun 2012 16:12:46 +0000 (+0200) Subject: Check for string X-Git-Tag: v4.5.0beta1~74^2~420^2~45^2~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6d68b7620cd38fda23d2d5dec73a80818035c38d;p=nextcloud-server.git Check for string --- diff --git a/lib/template.php b/lib/template.php index 35b941794b7..688199a878c 100644 --- a/lib/template.php +++ b/lib/template.php @@ -280,28 +280,16 @@ class OC_Template{ } -/* public function assign( $key, $value, $sanitizeHTML = true ){ - if(is_array($value) && $sanitizeHTML == true) { - array_walk_recursive($value,'OC_Template::sanitizeHTML'); - $this->vars[$key] = $value; - return true; - } - if($sanitizeHTML == true) { - $this->vars[$key] = htmlentities($value, ENT_QUOTES); - return true; - } - $this->vars[$key] = $value; - return true; - }*/ - /** * @brief Internaly used to sanitze HTML * * This function is internally used to sanitize HTML. */ private static function sanitizeHTML( &$value ){ + if(is_string($value)) { $value = htmlentities( $value, ENT_QUOTES ); return $value; + } } /**