r90206 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90205‎ | r90206 | r90207 >
Date:14:59, 16 June 2011
Author:jeroendedauw
Status:ok (Comments)
Tags:
Comment:
follow up to r90202
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/AskSpecial/SMW_SpecialAsk.php
@@ -663,10 +663,10 @@
664664 $navigation = Html::element(
665665 'a',
666666 array(
667 - 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL(
668 - 'offset=' . max( 0, $offset - $limit ) .
669 - '&limit=' . $limit . $urltail
670 - ),
 667+ 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( array(
 668+ 'offset' => max( 0, $offset - $limit ),
 669+ 'limit' => $limit . $urltail
 670+ ) ),
671671 'rel' => 'nofollow'
672672 ),
673673 wfMsg( 'smw_result_prev' )
@@ -687,10 +687,10 @@
688688 $navigation .= Html::element(
689689 'a',
690690 array(
691 - 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL(
692 - 'offset=' . ( $offset + $limit ) .
693 - '&limit=' . $limit . $urltail
694 - ),
 691+ 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( array(
 692+ 'offset' => ( $offset + $limit ),
 693+ 'limit' => $limit . $urltail
 694+ ) ),
695695 'rel' => 'nofollow'
696696 ),
697697 wfMsg( 'smw_result_next' )
@@ -715,10 +715,10 @@
716716 $navigation .= Html::element(
717717 'a',
718718 array(
719 - 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL(
720 - 'offset=' . $offset .
721 - '&limit=' . $l . $urltail
722 - ),
 719+ 'href' => SpecialPage::getSafeTitleFor( 'Ask' )->getLocalURL( array(
 720+ 'offset' => $offset,
 721+ 'limit' => $l . $urltail
 722+ ) ),
723723 'rel' => 'nofollow'
724724 ),
725725 $l

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90202correctly pass query args to getSafeTitleForjeroendedauw14:29, 16 June 2011

Comments

#Comment by Devayon (talk | contribs)   11:25, 9 July 2011

This commit gives me an odd error. How to replicate: 1) Go to Special:Ask. set Query to Located at ::germany and limit to '3'. 2) Find Results 3) Click Next On the page that loads, the limit field gets populated by parameter string of the url.

This is because $urltail is already urlencoded and it gets encoded yet again because of this commit.

#Comment by Jeroen De Dauw (talk | contribs)   11:50, 9 July 2011

Ah, I guess I wasn't careful enough there :) The urlencoding should happen as late as possible, in this case in the getLocalURL call. So feel free to remove the first urlencode. In general, you can just fix these kinds of small issues, esp if you know what's causing it. In such a commit, put "follow up to rxxxxx", where xxxxx is the revision number, and it'll be linked to that commit, and the person who made it will also get an email.

#Comment by Devayon (talk | contribs)   17:24, 9 July 2011

Thanks for pointing that out (about follow-ups and late url-encoding) :) The earlier encoding may be difficult to remove but I'll give it a try. Perhaps putting all those url-tail related lines in a separate method will keep things clean...

Status & tagging log