r90202 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90201‎ | r90202 | r90203 >
Date:14:29, 16 June 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
correctly pass query args to getSafeTitleFor
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php (modified) (history)
  • /trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php
@@ -238,16 +238,43 @@
239239 global $smwgQMaxInlineLimit;
240240
241241 if ( $this->offset > 0 ) {
242 - $navigation = '<a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'SearchByProperty', 'offset=' . max( 0, $this->offset - $this->limit ) . '&limit=' . $this->limit . '&property=' . urlencode( $this->property->getWikiValue() ) . '&value=' . urlencode( $this->value->getWikiValue() ) ) ) . '">' . wfMsg( 'smw_result_prev' ) . '</a>';
 242+ $navigation = Html::element(
 243+ 'a',
 244+ array(
 245+ 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
 246+ 'offset' => max( 0, $this->offset - $this->limit ),
 247+ 'limit' => $this->limit,
 248+ 'property' => $this->property->getWikiValue(),
 249+ 'value' => $this->value->getWikiValue()
 250+ ) )
 251+ ),
 252+ wfMsg( 'smw_result_prev' )
 253+ );
243254 }
244255 else {
245256 $navigation = wfMsg( 'smw_result_prev' );
246257 }
247258
248 - $navigation .= '&#160;&#160;&#160;&#160; <b>' . wfMsg( 'smw_result_results' ) . ' ' . ( $this->offset + 1 ) . '– ' . ( $this->offset + min( $count, $this->limit ) ) . '</b>&#160;&#160;&#160;&#160;';
 259+ $navigation .=
 260+ '&#160;&#160;&#160;&#160; <b>' .
 261+ wfMsg( 'smw_result_results' ) . ' ' .
 262+ ( $this->offset + 1 ) . '– ' .
 263+ ( $this->offset + min( $count, $this->limit ) ) .
 264+ '</b>&#160;&#160;&#160;&#160;';
249265
250266 if ( $count > $this->limit ) {
251 - $navigation .= ' <a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'SearchByProperty', 'offset=' . ( $this->offset + $this->limit ) . '&limit=' . $this->limit . '&property=' . urlencode( $this->property->getWikiValue() ) . '&value=' . urlencode( $this->value->getWikiValue() ) ) ) . '">' . wfMsg( 'smw_result_next' ) . '</a>';
 267+ $navigation .= Html::element(
 268+ 'a',
 269+ array(
 270+ 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
 271+ 'offset' => $this->offset + $this->limit,
 272+ 'limit' => $this->limit,
 273+ 'property' => $this->property->getWikiValue(),
 274+ 'value' => $this->value->getWikiValue()
 275+ ) )
 276+ ),
 277+ wfMsg( 'smw_result_next' )
 278+ );
252279 } else {
253280 $navigation .= wfMsg( 'smw_result_next' );
254281 }
@@ -271,7 +298,18 @@
272299 }
273300
274301 if ( $this->limit != $l ) {
275 - $navigation .= '<a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'SearchByProperty', 'offset=' . $this->offset . '&limit=' . $l . '&property=' . urlencode( $this->property->getWikiValue() ) . '&value=' . urlencode( $this->value->getWikiValue() ) ) ) . '">' . $l . '</a>';
 302+ $navigation .= Html::element(
 303+ 'a',
 304+ array(
 305+ 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
 306+ 'offset' => $this->offset,
 307+ 'limit' => $l,
 308+ 'property' => $this->property->getWikiValue(),
 309+ 'value' => $this->value->getWikiValue()
 310+ ) )
 311+ ),
 312+ $l
 313+ );
276314 } else {
277315 $navigation .= '<b>' . $l . '</b>';
278316 }
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php
@@ -176,10 +176,10 @@
177177 $body .= Html::element(
178178 'a',
179179 array(
180 - 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL(
181 - 'property=' . urlencode( $dvProperty->getWikiValue() ) .
182 - '&value=' . urlencode( $this->subject->getWikiValue() )
183 - )
 180+ 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array(
 181+ 'property' => $dvProperty->getWikiValue(),
 182+ 'value' => $this->subject->getWikiValue()
 183+ ) )
184184 ),
185185 wfMsg( "smw_browse_more" )
186186 );
@@ -302,10 +302,10 @@
303303 return Html::element(
304304 'a',
305305 array(
306 - 'href' => SpecialPage::getSafeTitleFor( 'Browse' )->getLocalURL(
307 - "offset={$offset}&dir={$dir}" .
308 - '&article=' . urlencode( $this->subject->getLongWikiText() ) . $frag
309 - )
 306+ 'href' => SpecialPage::getSafeTitleFor( 'Browse' )->getLocalURL( array(
 307+ 'offset' => "{$offset}&dir={$dir}",
 308+ 'article' => $this->subject->getLongWikiText() . $frag
 309+ ) )
310310 ),
311311 $text
312312 );
Index: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php
@@ -77,12 +77,12 @@
7878 $navigation = Html::element(
7979 'a',
8080 array(
81 - 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL(
82 - 'offset=' . max( 0, $offset - $limit ) .
83 - '&limit=' . $limit .
84 - '&type=' . urlencode( $propname ) .
85 - '&from=' . urlencode( $pagename )
86 - )
 81+ 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( array(
 82+ 'offset' => max( 0, $offset - $limit ),
 83+ 'limit' => $limit,
 84+ 'type' => $propname,
 85+ 'from' => $pagename
 86+ ) )
8787 ),
8888 wfMsg( 'smw_result_prev' )
8989 );
@@ -100,12 +100,12 @@
101101 $navigation = Html::element(
102102 'a',
103103 array(
104 - 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL(
105 - 'offset=' . ( $offset + $limit ) .
106 - '&limit=' . $limit .
107 - '&type=' . urlencode( $propname ) .
108 - '&from=' . urlencode( $pagename )
109 - )
 104+ 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( array(
 105+ 'offset' => ( $offset + $limit ),
 106+ 'limit' => $limit,
 107+ 'type' => $propname,
 108+ 'from' => $pagename
 109+ ) )
110110 ),
111111 wfMsg( 'smw_result_next' )
112112 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r90206follow up to r90202jeroendedauw14:59, 16 June 2011