From 273212973be25f2520f4b1afdf67529b319924a7 Mon Sep 17 00:00:00 2001 From: Sergio Date: Thu, 4 Jul 2019 16:40:07 +0100 Subject: [PATCH] DD-1429 : avoid "Error when visiting" error --- src/Dennis/Link/Checker/Analyzer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Dennis/Link/Checker/Analyzer.php b/src/Dennis/Link/Checker/Analyzer.php index 3241885..8c97b55 100644 --- a/src/Dennis/Link/Checker/Analyzer.php +++ b/src/Dennis/Link/Checker/Analyzer.php @@ -111,7 +111,11 @@ public function link(LinkInterface $link) { else { $url = $src; } - + // If url is protocol neutral, force it to use http. + if (substr( $url, 0, 2 ) === "//") { + $url = ltrim($url, '//'); + $url = 'http://' . $url; + } try { $info = $this->followRedirects($url); $link->setFoundUrl($info['url'])