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
$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