We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ada877 commit 77897b0Copy full SHA for 77897b0
spider/php/lib/HtmlParser.php
@@ -189,6 +189,11 @@ private function urlJoin($baseUrl, $relativeUrl) {
189
$scheme = isset($parts['scheme']) ? $parts['scheme'] . '://' : 'http://';
190
$host = isset($parts['host']) ? $parts['host'] : '';
191
192
+ // Handle protocol-relative URLs (starting with //)
193
+ if (substr($relativeUrl, 0, 2) == '//') {
194
+ return (isset($parts['scheme']) ? $parts['scheme'] . ':' : 'http:') . $relativeUrl;
195
+ }
196
+
197
if (substr($relativeUrl, 0, 1) == '/') {
198
return $scheme . $host . $relativeUrl;
199
}
0 commit comments