Last modified: 2013-10-16 21:44:05 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T57761, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 55761 - wgSecureLogin redirect to https drops campaign and other URL parameters
wgSecureLogin redirect to https drops campaign and other URL parameters
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
User login and signup (Other open bugs)
1.22.0
All All
: High normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-15 21:37 UTC by spage
Modified: 2013-10-16 21:44 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description spage 2013-10-15 21:37:55 UTC
Now that $wgSecureLogin defaults to true for most WMF wikis, Special:UserLogin/signup redirects account creation to https. When it does so it drops all URL parameters to signup apart from returnto and returntoquery.

As a result, we're losing campaign information, and other control over login such as &showGettingStarted=false.

To reproduce:
Browse enwiki over http, visit a random page, click Edit, if the yellowish "You are not logged in...." anoneditwarning bar appears, then note the http: link for " or create an account" contains &campaign=anoneditwarning"

But when you click it, you are redirected to
https://en.wikipedia.org/w/index.php?title=Special:UserLogin/signup&returnto=Ectoedemia_sabina&returntoquery=&fromhttp=1

with no campaign parameter.

One fix is to test for campaign and add it back to the $query, in the execute() function in includes/specials/SpecialUserlogin.php. Or, include all query string parameters in the redirect URL.
Comment 1 Matthew Flaschen 2013-10-15 22:27:01 UTC
campaign is not part of core, so if you need to add it here, it should be through a hook.

But is there any reason not to preserve the entire query string (then add fromhttp=1)?
Comment 2 Chris Steipp 2013-10-15 22:40:26 UTC
spage, whatever is inserting that link isn't accounting for the campaign parameter correctly. The signup form is correct redirecting back to the passed in returnto and returntoquery, which that link is incorrectly generating. For example, if you manually add "&campaign=asdf" to your url, and then click the normal nav bar's "Create account", the returntoquery is correctly set.
Comment 3 Matthew Flaschen 2013-10-15 22:47:02 UTC
Chris, it's not meant to be a parameter on the page they come back to (e.g. we don't want to send them to https://en.wikipedia.org/wiki/Ectoedemia_sabina?campaign=foo.  It's meant to be a parameter on the create page itself, since it's checked in the UserCreateForm hook.  I.E.

https://en.wikipedia.org/w/index.php?title=Special:UserLogin/signup&returnto=Ectoedemia_sabina&returntoquery=&campaign=foo&fromhttp=1
Comment 4 spage 2013-10-16 01:07:17 UTC
(In reply to comment #1)
> But is there any reason not to preserve the entire query string (then add
> fromhttp=1)?

Not that I can see for the purposes of the redirect. In load(), SpecialUserlogin.php adjusts mReturnTo and mReturnToQuery and on $wgSecureLogin redirect builds a new query string out of them; but my hunch is there's no harm redirecting to https with the entire original query string, and doing all query param processing in https processing.
Comment 5 Steven Walling 2013-10-16 01:35:12 UTC
Setting to high priority since this means ongoing data collection is being interrupted. Visible at: http://ee-dashboard.wmflabs.org/graphs/enwiki_campaigns
Comment 6 Gerrit Notification Bot 2013-10-16 14:34:03 UTC
Change 90125 had a related patch set uploaded by Anomie:
Include miscellaneous query parameters in $wgSecureLogin redirect

https://gerrit.wikimedia.org/r/90125
Comment 7 Gerrit Notification Bot 2013-10-16 17:08:15 UTC
Change 90125 merged by jenkins-bot:
Include miscellaneous query parameters in $wgSecureLogin redirect

https://gerrit.wikimedia.org/r/90125
Comment 8 Steven Walling 2013-10-16 21:44:05 UTC
https://gerrit.wikimedia.org/r/#/c/90125/ reviewed and merged

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links