r66059 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66058‎ | r66059 | r66060 >
Date:07:08, 8 May 2010
Author:tisane
Status:deferred
Tags:
Comment:
Decode API URLs; use fragments in wikilink URLs
Modified paths:
  • /trunk/extensions/RPED/ApiRPED.php (modified) (history)
  • /trunk/extensions/RPED/RPED.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RPED/RPED.hooks.php
@@ -62,6 +62,7 @@
6363 // remote wiki (Wikipedia)
6464 if ( in_array( 'broken', $options ) || $itIsBlank == true ) {
6565 $title = $target->getPrefixedText ();
 66+ $fragment = htmlentities($target->getFragmentForURL());
6667
6768 for ( $thiscount = 0; $thiscount < strlen( $title ); $thiscount++ ) {
6869 if ( substr( $title, $thiscount, 1 ) == ' ' ) {
@@ -82,7 +83,7 @@
8384 $url = wfMsgExt( 'rped-wikipedia-url','parsemag') . $title;
8485
8586 // The page that we'll link to
86 - $text = '<a href="' . $url . '">' . $text . '</a>';
 87+ $text = '<a href="' . $url . $fragment. '">' . $text. '</a>';
8788
8889 if ( $wgRemoteStyle != '' ) {
8990 $customAttribs['style'] = $wgRemoteStyle;
Index: trunk/extensions/RPED/ApiRPED.php
@@ -53,6 +53,7 @@
5454 if( isset( $myInput ) ) {
5555 foreach( $myInput as $subValue ) {
5656 if ( isset( $subValue ) && $subValue !== null ) {
 57+ $subValue=urldecode($subValue);
5758 $existCheck = null;
5859 $existCheck = $dbr->selectRow( 'rped_page', 'rped_page_title',
5960 array( 'rped_page_title' => $subValue ) );

Status & tagging log