Skip to content

Commit 6e717a3

Browse files
committed
[DomCrawler] Made sure only the default namespace is removed when loading an XML content.
1 parent e5b8abb commit 6e717a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/DomCrawler/Crawler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ public function addXmlContent($content, $charset = 'UTF-8')
197197
$dom->validateOnParse = true;
198198

199199
// remove the default namespace to make XPath expressions simpler
200-
@$dom->loadXML(str_replace('xmlns', 'ns', $content), LIBXML_NONET);
200+
@$dom->loadXML(str_replace('xmlns=', 'ns=', $content), LIBXML_NONET);
201201

202202
libxml_use_internal_errors($current);
203203
libxml_disable_entity_loader($disableEntities);

0 commit comments

Comments
 (0)