http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90202
Revision: 90202 Author: jeroendedauw Date: 2011-06-16 14:29:57 +0000 (Thu, 16 Jun 2011) Log Message: ----------- correctly pass query args to getSafeTitleFor Modified Paths: -------------- trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php Modified: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php =================================================================== --- trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php 2011-06-16 13:55:14 UTC (rev 90201) +++ trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialBrowse.php 2011-06-16 14:29:57 UTC (rev 90202) @@ -176,10 +176,10 @@ $body .= Html::element( 'a', array( - 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( - 'property=' . urlencode( $dvProperty->getWikiValue() ) . - '&value=' . urlencode( $this->subject->getWikiValue() ) - ) + 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( + 'property' => $dvProperty->getWikiValue(), + 'value' => $this->subject->getWikiValue() + ) ) ), wfMsg( "smw_browse_more" ) ); @@ -302,10 +302,10 @@ return Html::element( 'a', array( - 'href' => SpecialPage::getSafeTitleFor( 'Browse' )->getLocalURL( - "offset={$offset}&dir={$dir}" . - '&article=' . urlencode( $this->subject->getLongWikiText() ) . $frag - ) + 'href' => SpecialPage::getSafeTitleFor( 'Browse' )->getLocalURL( array( + 'offset' => "{$offset}&dir={$dir}", + 'article' => $this->subject->getLongWikiText() . $frag + ) ) ), $text ); Modified: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php =================================================================== --- trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php 2011-06-16 13:55:14 UTC (rev 90201) +++ trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialPageProperty.php 2011-06-16 14:29:57 UTC (rev 90202) @@ -77,12 +77,12 @@ $navigation = Html::element( 'a', array( - 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( - 'offset=' . max( 0, $offset - $limit ) . - '&limit=' . $limit . - '&type=' . urlencode( $propname ) . - '&from=' . urlencode( $pagename ) - ) + 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( array( + 'offset' => max( 0, $offset - $limit ), + 'limit' => $limit, + 'type' => $propname, + 'from' => $pagename + ) ) ), wfMsg( 'smw_result_prev' ) ); @@ -100,12 +100,12 @@ $navigation = Html::element( 'a', array( - 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( - 'offset=' . ( $offset + $limit ) . - '&limit=' . $limit . - '&type=' . urlencode( $propname ) . - '&from=' . urlencode( $pagename ) - ) + 'href' => SpecialPage::getSafeTitleFor( 'PageProperty' )->getLocalURL( array( + 'offset' => ( $offset + $limit ), + 'limit' => $limit, + 'type' => $propname, + 'from' => $pagename + ) ) ), wfMsg( 'smw_result_next' ) ); Modified: trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php =================================================================== --- trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php 2011-06-16 13:55:14 UTC (rev 90201) +++ trunk/extensions/SemanticMediaWiki/specials/SearchTriple/SMW_SpecialSearchByProperty.php 2011-06-16 14:29:57 UTC (rev 90202) @@ -238,16 +238,43 @@ global $smwgQMaxInlineLimit; if ( $this->offset > 0 ) { - $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>'; + $navigation = Html::element( + 'a', + array( + 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( + 'offset' => max( 0, $this->offset - $this->limit ), + 'limit' => $this->limit, + 'property' => $this->property->getWikiValue(), + 'value' => $this->value->getWikiValue() + ) ) + ), + wfMsg( 'smw_result_prev' ) + ); } else { $navigation = wfMsg( 'smw_result_prev' ); } - $navigation .= '     <b>' . wfMsg( 'smw_result_results' ) . ' ' . ( $this->offset + 1 ) . '– ' . ( $this->offset + min( $count, $this->limit ) ) . '</b>    '; + $navigation .= + '     <b>' . + wfMsg( 'smw_result_results' ) . ' ' . + ( $this->offset + 1 ) . '– ' . + ( $this->offset + min( $count, $this->limit ) ) . + '</b>    '; if ( $count > $this->limit ) { - $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>'; + $navigation .= Html::element( + 'a', + array( + 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( + 'offset' => $this->offset + $this->limit, + 'limit' => $this->limit, + 'property' => $this->property->getWikiValue(), + 'value' => $this->value->getWikiValue() + ) ) + ), + wfMsg( 'smw_result_next' ) + ); } else { $navigation .= wfMsg( 'smw_result_next' ); } @@ -271,7 +298,18 @@ } if ( $this->limit != $l ) { - $navigation .= '<a href="' . htmlspecialchars( $skin->makeSpecialUrl( 'SearchByProperty', 'offset=' . $this->offset . '&limit=' . $l . '&property=' . urlencode( $this->property->getWikiValue() ) . '&value=' . urlencode( $this->value->getWikiValue() ) ) ) . '">' . $l . '</a>'; + $navigation .= Html::element( + 'a', + array( + 'href' => SpecialPage::getSafeTitleFor( 'SearchByProperty' )->getLocalURL( array( + 'offset' => $this->offset, + 'limit' => $l, + 'property' => $this->property->getWikiValue(), + 'value' => $this->value->getWikiValue() + ) ) + ), + $l + ); } else { $navigation .= '<b>' . $l . '</b>'; } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs