The default value of the $mReturnTo and $mReturnToQuery member variables is '',
even if they were not passed. This means that they would always be present
in the redirected URL when accessing Special:Userlogin from HTTP and HTTPS
is available.
Now the special case '' is changed to null so that they don't appear anymore
if not needed.
Change-Id: I49a085feaa49d4b2954ff280db241234d2d46258
if ( $this->mRequest->getProtocol() !== 'https' ) {
$title = $this->getFullTitle();
$query = array(
- 'returnto' => $this->mReturnTo,
- 'returntoquery' => $this->mReturnToQuery,
+ 'returnto' => $this->mReturnTo !== '' ? $this->mReturnTo : null,
+ 'returntoquery' => $this->mReturnToQuery !== '' ?
+ $this->mReturnToQuery : null,
'title' => null,
) + $this->mRequest->getQueryValues();
$url = $title->getFullURL( $query, false, PROTO_HTTPS );