From f1088f81742e1b42305fb9dab298bead864217a9 Mon Sep 17 00:00:00 2001 From: gar Date: Tue, 11 Nov 2008 23:06:00 +0000 Subject: [PATCH] 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 --- XMPPHP/XMLStream.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/XMPPHP/XMLStream.php b/XMPPHP/XMLStream.php index f206dd9..809716f 100644 --- a/XMPPHP/XMLStream.php +++ b/XMPPHP/XMLStream.php @@ -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);