From: Marius Hoch Date: Tue, 23 Oct 2012 23:18:08 +0000 (+0200) Subject: (bug 36053) Login returnto doesn't work if title isn't in the URI X-Git-Tag: 1.31.0-rc.0~21571^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=08d14337cce18b5d2377713628664369ab500af0;p=lhc%2Fweb%2Fwiklou.git (bug 36053) Login returnto doesn't work if title isn't in the URI 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 --- diff --git a/RELEASE-NOTES-1.21 b/RELEASE-NOTES-1.21 index 7c932eff11..5abdd1efed 100644 --- a/RELEASE-NOTES-1.21 +++ b/RELEASE-NOTES-1.21 @@ -77,6 +77,8 @@ production. * (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 diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 341983d311..173d37af6f 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -555,7 +555,11 @@ class SkinTemplate extends Skin { # $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 ) !== '' ) {