File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
src/Symfony/Component/DomCrawler Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -89,11 +89,23 @@ public function getUri()
89
89
return $ this ->currentUri ;
90
90
}
91
91
92
- // only an anchor or a query string
93
- if (in_array ( $ uri [0 ], array ( ' ? ' , ' # ' )) ) {
92
+ // only an anchor
93
+ if (' # ' === $ uri [0 ]) {
94
94
return $ this ->currentUri .$ uri ;
95
95
}
96
96
97
+ // only a query string
98
+ if ('? ' === $ uri [0 ] ) {
99
+ $ baseUri = $ this ->currentUri ;
100
+
101
+ // remove the query string from the current uri
102
+ if (false !== ($ pos = strpos ($ this ->currentUri , '? ' ))) {
103
+ $ baseUri = substr ($ this ->currentUri , 0 , strpos ($ this ->currentUri , '? ' ));
104
+ }
105
+
106
+ return $ baseUri .$ uri ;
107
+ }
108
+
97
109
// absolute path
98
110
if ('/ ' === $ uri [0 ]) {
99
111
return preg_replace ('#^(.*?//[^/]+)(?:\/.*)?$# ' , '$1 ' , $ this ->currentUri ).$ uri ;
You can’t perform that action at this time.
0 commit comments