Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevs.class.php |
— | — | @@ -393,14 +393,16 @@ |
394 | 394 | |
395 | 395 | /** |
396 | 396 | * Get the 'diffonly=' value for diff URLs. Either ('1','0','') |
397 | | - * @return string |
| 397 | + * @return array |
398 | 398 | */ |
399 | 399 | public static function diffOnlyCGI() { |
400 | 400 | $val = trim( wfMsgForContent( 'flaggedrevs-diffonly' ) ); |
401 | | - if ( $val === '&diffonly=1' || $val === '&diffonly=0' ) { |
402 | | - return $val; |
403 | | - } |
404 | | - return ''; |
| 401 | + if ( strpos( $val, '&diffonly=1' ) !== false ) { |
| 402 | + return array( 'diffonly' => 1 ); |
| 403 | + } elseif ( strpos( $val, '&diffonly=0' ) !== false ) { |
| 404 | + return array( 'diffonly' => 0); |
| 405 | + } |
| 406 | + return array(); |
405 | 407 | } |
406 | 408 | |
407 | 409 | # ################ Permission functions ################# |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsUI.hooks.php |
— | — | @@ -567,7 +567,8 @@ |
568 | 568 | $title, |
569 | 569 | wfMsgHtml( 'revreview-reviewlink' ), |
570 | 570 | array( 'title' => wfMsg( 'revreview-reviewlink-title' ) ), |
571 | | - array( 'oldid' => $rc->mAttribs['fp_stable'], 'diff' => 'cur' ) |
| 571 | + array( 'oldid' => $rc->mAttribs['fp_stable'], 'diff' => 'cur' ) + |
| 572 | + FlaggedRevs::diffOnlyCGI() |
572 | 573 | ); |
573 | 574 | $css = 'flaggedrevs-pending'; |
574 | 575 | } |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/PendingChanges_body.php |
— | — | @@ -220,7 +220,8 @@ |
221 | 221 | $review = $this->skin->linkKnown( $title, |
222 | 222 | wfMsg( 'pendingchanges-diff' ), |
223 | 223 | array(), |
224 | | - 'diff=cur&oldid=' . (int)$row->stable . FlaggedRevs::diffOnlyCGI() ); |
| 224 | + array( 'diff' => 'cur', 'oldid' => $row->stable ) + FlaggedRevs::diffOnlyCGI() |
| 225 | + ); |
225 | 226 | # Show quality level if there are several |
226 | 227 | if ( FlaggedRevs::qualityVersions() ) { |
227 | 228 | $quality = $row->quality |
Index: trunk/extensions/FlaggedRevs/presentation/specialpages/reports/ProblemChanges_body.php |
— | — | @@ -185,10 +185,11 @@ |
186 | 186 | |
187 | 187 | $title = Title::newFromRow( $row ); |
188 | 188 | $link = $this->skin->link( $title ); |
189 | | - $review = $this->skin->knownLink( $title, |
| 189 | + $review = $this->skin->linkKnown( $title, |
190 | 190 | wfMsg( 'pendingchanges-diff' ), |
191 | 191 | array(), |
192 | | - 'diff=cur&oldid=' . (int)$row->stable . FlaggedRevs::diffOnlyCGI() ); |
| 192 | + array( 'diff' => 'cur', 'oldid' => $row->stable ) + FlaggedRevs::diffOnlyCGI() |
| 193 | + ); |
193 | 194 | # Show quality level if there are several |
194 | 195 | if ( FlaggedRevs::qualityVersions() ) { |
195 | 196 | $quality = $row->quality |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php |
— | — | @@ -1492,7 +1492,7 @@ |
1493 | 1493 | $review = $wgUser->getSkin()->makeKnownLinkObj( |
1494 | 1494 | $article->getTitle(), |
1495 | 1495 | wfMsgHtml( 'review-diff2stable' ), |
1496 | | - 'oldid=' . $srev->getRevId() . '&diff=cur' . FlaggedRevs::diffOnlyCGI() |
| 1496 | + array( 'oldid' => $srev->getRevId(), 'diff' => 'cur' ) + FlaggedRevs::diffOnlyCGI() |
1497 | 1497 | ); |
1498 | 1498 | $review = wfMsgHtml( 'parentheses', $review ); |
1499 | 1499 | $review = "<div class='fr-diff-to-stable' align='center'>$review</div>"; |
— | — | @@ -1648,21 +1648,19 @@ |
1649 | 1649 | if ( !$frev || !$this->article->revsArePending() ) { |
1650 | 1650 | return true; // only for pages with pending edits |
1651 | 1651 | } |
| 1652 | + $params = array(); |
1652 | 1653 | // If the edit was not autoreviewed, and the user can actually make a |
1653 | 1654 | // new stable version, then go to the diff... |
1654 | 1655 | if ( $frev->userCanSetFlags( $wgUser ) ) { |
1655 | | - $extraQuery .= $extraQuery ? '&' : ''; |
1656 | | - // Override diffonly setting to make sure the content is shown |
1657 | | - $extraQuery .= 'oldid=' . $frev->getRevId() . |
1658 | | - '&diff=cur' . FlaggedRevs::diffOnlyCGI() . '&shownotice=1'; |
| 1656 | + $params += array( 'oldid' => $frev->getRevId(), 'diff' => 'cur', 'shownotice' => 1 ); |
| 1657 | + $params += FlaggedRevs::diffOnlyCGI(); |
1659 | 1658 | // ...otherwise, go to the draft revision after completing an edit. |
1660 | 1659 | // This allows for users to immediately see their changes. |
1661 | 1660 | } else { |
1662 | | - $extraQuery .= $extraQuery ? '&' : ''; |
1663 | | - $extraQuery .= 'stable=0'; |
| 1661 | + $params += array( 'stable' => 0 ); |
1664 | 1662 | // Show a notice at the top of the page for non-reviewers... |
1665 | 1663 | if ( !$wgUser->isAllowed( 'review' ) && $this->article->isStableShownByDefault() ) { |
1666 | | - $extraQuery .= '&shownotice=1'; |
| 1664 | + $params += array( 'shownotice' => 1 ); |
1667 | 1665 | if ( $sectionAnchor ) { |
1668 | 1666 | // Pass a section parameter in the URL as needed to add a link to |
1669 | 1667 | // the "your changes are pending" box on the top of the page... |
— | — | @@ -1670,11 +1668,12 @@ |
1671 | 1669 | array( ':' , '.' ), array( '%3A', '%' ), // hack: reverse encoding |
1672 | 1670 | substr( $sectionAnchor, 1 ) // remove the '#' |
1673 | 1671 | ); |
1674 | | - $extraQuery .= '&fromsection=' . $section; |
| 1672 | + $params += array('fromsection' => $section ); |
1675 | 1673 | $sectionAnchor = ''; // go to the top of the page to see notice |
1676 | 1674 | } |
1677 | 1675 | } |
1678 | 1676 | } |
| 1677 | + $extraQuery = wfAppendQuery( $extraQuery, $params ); |
1679 | 1678 | return true; |
1680 | 1679 | } |
1681 | 1680 | |
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedRevsLogView.php |
— | — | @@ -126,7 +126,7 @@ |
127 | 127 | $links .= $wgUser->getSkin()->makeKnownLinkObj( |
128 | 128 | $title, |
129 | 129 | wfMsgHtml( 'review-logentry-id', $revId, $time ), |
130 | | - "oldid={$revId}&diff=prev" . FlaggedRevs::diffOnlyCGI() |
| 130 | + array( 'oldid' => $revId, 'diff' => 'prev' ) + FlaggedRevs::diffOnlyCGI() |
131 | 131 | ); |
132 | 132 | $links .= ')'; |
133 | 133 | } |