fixed xpath parsing to allow for / character in namespace (for instance: '{http://etherx.jabber.org/streams}features' )

git-svn-id: svn://netflint.net/xmpphp@62 ef36c318-a008-4979-b6e8-6b496270793b
This commit is contained in:
gar 2008-11-11 23:06:00 +00:00
parent 6860070b7e
commit f1088f8174
1 changed files with 6 additions and 1 deletions

View File

@ -253,7 +253,12 @@ class XMPPHP_XMLStream {
* @param
*/
public function addXPathHandler($xpath, $pointer, $obj = null) {
foreach(split("/", $xpath) as $ns_tag) {
if (preg_match_all("/\(?{[^\}]+}\)?(\/?)[^\/]+/", $xpath, $regs)) {
$ns_tags = $regs[0];
} else {
$ns_tags = array($xpath);
}
foreach($ns_tags as $ns_tag) {
list($l, $r) = split("}", $ns_tag);
if ($r != null) {
$xpart = array(substr($l, 1), $r);