Returnto after login didn't work if title wasn't given as URI
parameter. I'm using $this->getTitle() to find it out, in case
the user got read rights (per code comment above my change).
Change-Id: I14d92581ce790355404d3c184fa6542a24f7a130
* (bug 2865) User interface HTML elements don't use lang attribute
(completed the fix by adding the lang attribute to firstHeading)
* (bug 42173) Removed namespace prefixes on Special:UncategorizedCategories.
+* (bug 36053) Log in "returnto" feature forgets query parameters if no
+ title parameter was specified.
=== API changes in 1.21 ===
* prop=revisions can now report the contentmodel and contentformat, see docs/contenthandler.txt
# $this->getTitle() will just give Special:Badtitle, which is
# not especially useful as a returnto parameter. Use the title
# from the request instead, if there was one.
- $page = Title::newFromURL( $request->getVal( 'title', '' ) );
+ if ( $this->getUser()->isAllowed( 'read' ) ) {
+ $page = $this->getTitle();
+ } else {
+ $page = Title::newFromText( $request->getVal( 'title', '' ) );
+ }
$page = $request->getVal( 'returnto', $page );
$a = array();
if ( strval( $page ) !== '' ) {