Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b6af002

Browse filesBrowse files
committed
[DomCrawler] Improve namespace discovery performance
Up until now xpath axes (child::*, descendant-or-self::** etc) were considered namespaces. As a result, far too many xpath queries were being executed while namespace discovery.
1 parent 49c60d7 commit b6af002
Copy full SHA for b6af002

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎src/Symfony/Component/DomCrawler/Crawler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Crawler.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ private function discoverNamespace(\DOMXPath $domxpath, $prefix)
10271027
*/
10281028
private function findNamespacePrefixes($xpath)
10291029
{
1030-
if (preg_match_all('/(?P<prefix>[a-z_][a-z_0-9\-\.]*):[^"\/]/i', $xpath, $matches)) {
1030+
if (preg_match_all('/(?P<prefix>[a-z_][a-z_0-9\-\.]*):[^"\/:]/i', $xpath, $matches)) {
10311031
return array_unique($matches['prefix']);
10321032
}
10331033

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.