diff --git a/CHANGELOG b/CHANGELOG index 2a5eb62..b0ee03c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ == ChangeLog for RottenLinks == +=== 1.0.14 (05-06-2021) === +* Make protocols lowercase before making request + === 1.0.13 (13-05-2021) === * Use HttpRequestFactory diff --git a/extension.json b/extension.json index 22f32bc..f421925 100644 --- a/extension.json +++ b/extension.json @@ -1,6 +1,6 @@ { "name": "RottenLinks", - "version": "1.0.13", + "version": "1.0.14", "author": [ "John Lewis" ], diff --git a/includes/RottenLinks.php b/includes/RottenLinks.php index bf10bac..54c719f 100644 --- a/includes/RottenLinks.php +++ b/includes/RottenLinks.php @@ -7,9 +7,15 @@ public static function getResponse( $url ) { $services = MediaWikiServices::getInstance(); $config = $services->getConfigFactory()->makeConfig( 'rottenlinks' ); - + + // Make the protocol lowercase + $urlexp = explode( '://', $url); + $proto = strtolower( $urlexp[0] ) . '://'; + $site = $urlexp[1]; + $urlToUse = $proto . $site; + $request = $services->getHttpRequestFactory()->create( - $url, [ + $urlToUse, [ 'method' => 'HEAD', // return headers only 'timeout' => $config->get( 'RottenLinksCurlTimeout' ), 'userAgent' => 'RottenLinks, MediaWiki extension (https://github.com/miraheze/RottenLinks), running on ' . $config->get( 'Server' )