Explorar o código

xml sanitize allow $1 and $2

Continue to remove any ${variables}  in this format
FusionPBX hai 1 ano
pai
achega
473b787bed
Modificáronse 1 ficheiros con 10 adicións e 9 borrados
  1. 10 9
      resources/classes/xml.php

+ 10 - 9
resources/classes/xml.php

@@ -1,16 +1,17 @@
 <?php
 <?php
 
 
 if (!class_exists('xml')) {
 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);
+		}
 
 
-    }
+	}
 }
 }
 
 
-?>
+?>