From: umherirrender Date: Sat, 26 Apr 2014 20:34:21 +0000 (+0200) Subject: http -> https rewrite: Only replace one http by https X-Git-Tag: 1.31.0-rc.0~15994 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=bb81516af40d25f456980cdf5eedd1e2a3392466;p=lhc%2Fweb%2Fwiklou.git 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 --- 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