xml.php 304 B

1234567891011121314151617
  1. <?php
  2. if (!class_exists('xml')) {
  3. class xml {
  4. /**
  5. * Escapes xml special characters to html entities and sanitze switch special chars.
  6. */
  7. static function sanitize($string) {
  8. $string = preg_replace('/\$\{[^}]+\}/', '', $string);
  9. return htmlspecialchars($string, ENT_XML1);
  10. }
  11. }
  12. }
  13. ?>