xml sanitize allow $1 and $2

Continue to remove any ${variables}  in this format
This commit is contained in:
FusionPBX 2023-08-30 12:50:08 -06:00 committed by GitHub
parent 9f7f30a507
commit 40a7ed7b15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 9 deletions

View File

@ -1,16 +1,17 @@
<?php
if (!class_exists('xml')) {
class xml {
class xml {
/**
* Escapes xml special characters to html entities and sanitze switch special chars.
*/
static function sanitize($string) {
return str_replace('$', '', htmlspecialchars($string, ENT_XML1));
}
/**
* Escapes xml special characters to html entities and sanitze switch special chars.
*/
static function sanitize($string) {
$string = preg_replace('/\$\{[^}]+\}/', '', $string);
return htmlspecialchars($string, ENT_XML1);
}
}
}
}
?>
?>