Last modified: 2014-07-07 19:06:28 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 T47219, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 45219 - Add tour as allowed special page redirect parameter
Add tour as allowed special page redirect parameter
Status: REOPENED
Product: MediaWiki extensions
Classification: Unclassified
GuidedTour (Other open bugs)
master
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-21 05:56 UTC by Matthew Flaschen
Modified: 2014-07-07 19:06 UTC (History)
7 users (show)

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


Attachments

Description Matthew Flaschen 2013-02-21 05:56:52 UTC
As discussed at https://en.wikipedia.org/wiki/User_talk:Sage_Ross_%28WMF%29/sandbox, tour is not allowed as a special page parameter when redirecting.  

This is particularly useful for Special:MyPage.  However, there is one hook, RedirectSpecialArticleRedirectParams, that controls this for all special pages.

Adding 'tour' should not pose a security problem, since tour JavaScript is limited to the MW namespace and extension code, which are only modifiable by trusted users.
Comment 1 Sage Ross 2013-03-22 18:07:10 UTC
This would be especially useful to me, as I'd like to include a guidedtour link to Special:MyPage as part of the Wikipedia:Training pages. Users really want to see some interactive practice editing as part of the training, and I'm waiting on this before trying to incorporate it into the trainings.
Comment 2 Matthew Flaschen 2013-03-22 23:59:47 UTC
Done in https://gerrit.wikimedia.org/r/#/c/55445/, pending review.
Comment 3 Matthew Flaschen 2013-03-26 23:07:56 UTC
Merged.
Comment 5 Helder 2014-01-18 17:25:16 UTC
Ping
Comment 6 Matthew Flaschen 2014-01-18 17:53:36 UTC
I've added this to our Trello.  The issue is that, "there is one hook,
RedirectSpecialArticleRedirectParams, that controls this for all special pages" was not correct.

RedirectSpecialArticleRedirectParams only affects redirects to "Articles".  However, the definition of Article in core is basically any real (non-special page).  That still doesn't include Special:Contributions, which is the issue.

This may need a new hook added to core, and it needs security review to make sure tours don't run on the login or create account pages.
Comment 7 Matthew Flaschen 2014-07-07 19:06:28 UTC
Sam, I think adding a new hook in SpecialRedirectToSpecial (as you suggested on IRC) should be fine.

The alternative would be to add it to RedirectSpecialPage (the parent class), but SpecialRedirectToSpecial is the more granular approach (it can be RedirectSpecialArticle, SpecialRedirectToSpecial, both, or neither).

The starting array (to be modified by the hook) should be the one passed to the SpecialRedirectToSpecial constructor ($allowedRedirectParams).

Also, it should probably pass $this to the hook (as the first parameter), so the listener can optionally vary its behavior depending on the special page (e.g. $this->mName).

It should be safe for GuidedTour, since there is already the $isUserJsAllowed check in GuidedTourHooks.php, but this should be tested.

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


Navigation
Links