Skip to content

Commit d670087

Browse files
authored
Fix for quotation marks in redirect URL
Some websites use quotation marks around the url= query in the meta-refresh tag. Example: https://presse.stuttgart-tourist.de/die-weihnachtsmaerkte-in-der-region-stuttgart <meta HTTP-EQUIV="refresh" content="0;url='https://presse.stuttgart-tourist.de/die-weihnachtsmaerkte-in-der-region-stuttgart?PageSpeed=noscript'" /> Those have to be trimmed or an error (GuzzleHttp\Psr7\Exception\MalformedUriException: A relative URI must not have a path beginning with a segment containing a colon) is triggered
1 parent 3b38c92 commit d670087

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Detectors/Redirect.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function detect(): ?UriInterface
1818
private function extract(string $value): ?UriInterface
1919
{
2020
if (preg_match('/url=(.+)$/i', $value, $match)) {
21-
return $this->extractor->resolveUri($match[1]);
21+
return $this->extractor->resolveUri(trim($match[1], '\'"'));
2222
}
2323

2424
return null;

0 commit comments

Comments
 (0)