From bb81516af40d25f456980cdf5eedd1e2a3392466 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 26 Apr 2014 22:34:21 +0200 Subject: [PATCH] http -> https rewrite: Only replace one http by https This avoids changing from http://de.wikipedia.org/wiki/Spezial:Weblinksuche/http://wikimedia.org to https://de.wikipedia.org/wiki/Spezial:Weblinksuche/https://wikimedia.org instead of https://de.wikipedia.org/wiki/Spezial:Weblinksuche/http://wikimedia.org Bug: 63573 Change-Id: Ife5099c3c5a0e943bb08b81be5d5669d0e02be17 --- includes/Wiki.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index 2ef1382afd..aed1f65cb3 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -542,7 +542,7 @@ class MediaWiki { $request->getProtocol() == 'http' ) { $oldUrl = $request->getFullRequestURL(); - $redirUrl = str_replace( 'http://', 'https://', $oldUrl ); + $redirUrl = preg_replace( '#^http://#', 'https://', $oldUrl ); if ( $request->wasPosted() ) { // This is weird and we'd hope it almost never happens. This -- 2.20.1