X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;ds=sidebyside;f=class%2Fxml%2Ftree%2FNode.php;h=7fd0058987f4b0545b59ce16e1e91a13c77085d4;hb=23e34b5392cff0a51784474cd0d37b1ac4bc7a23;hp=36b49d8cf300a890bd5776aac7057daa82c1bb92;hpb=8ffd248f6d034d42a293594e5ed55b83c14da67c;p=lifetype%2F.git diff --git a/class/xml/tree/Node.php b/class/xml/tree/Node.php index 36b49d8..7fd0058 100644 --- a/class/xml/tree/Node.php +++ b/class/xml/tree/Node.php @@ -550,6 +550,7 @@ class XML_Tree_Node { $xml ); + if(function_exists('preg_replace_callback_array')){ $xml = preg_replace_callback_array( [ "/\&([a-z\d\#]+)\;/i" => function($matches) { @@ -565,6 +566,20 @@ class XML_Tree_Node { return '&#'.ord($matches[1]).';'; } ], $xml); + } + else { + $xml = preg_replace(array("/\&([a-z\d\#]+)\;/i", + "/\&/", + "/\#\|\|([a-z\d\#]+)\|\|\#/i", + "/([^a-zA-Z\d\s\<\>\&\;\.\:\=\"\-\/\%\?\!\'\(\)\[\]\{\}\$\#\+\,\@_])/e" + ), + array("#||\\1||#", + "&", + "'&#'.ord('\\1').';'" + ), + $xml + ); + } return $xml; }