CC-6055: Improved escaping

This commit is contained in:
Albert Santoni 2015-06-12 13:48:54 -04:00
parent abc81a92b4
commit b4c9a77e7c
10 changed files with 46 additions and 50 deletions

View file

@ -1,11 +1,15 @@
<?php
/**
* Created by PhpStorm.
* User: asantoni
* Date: 12/06/15
* Time: 12:24 PM
*/
class SecurityHelper {
public static function htmlescape_recursive(&$arr) {
foreach ($arr as $key => $val) {
if (is_array($val)) {
self::htmlescape_recursive($arr[$key]);
} else if (is_string($val)) {
$arr[$key] = htmlspecialchars($val, ENT_QUOTES);
}
}
return $arr;
}
}