CC-6055: Improved escaping
This commit is contained in:
parent
abc81a92b4
commit
b4c9a77e7c
10 changed files with 46 additions and 50 deletions
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue