r51398 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51397‎ | r51398 | r51399 >
Date:12:53, 3 June 2009
Author:jojo
Status:ok
Tags:
Comment:
do not use URLs in return_to but internal title
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.hooks.php
@@ -250,7 +250,7 @@
251251 array( 'onclick' => "if (confirm('$msg')) return true; else return false;",
252252 'rel' => 'nofollow',
253253 'title' => wfMsg( "coll-clear_collection_tooltip" ) ),
254 - array( 'return_to' => $wgTitle->getFullURL() ),
 254+ array( 'return_to' => $wgTitle->getPrefixedText() ),
255255 array( 'known', 'noclasses' )
256256 )
257257 );
Index: trunk/extensions/Collection/Collection.body.php
@@ -83,7 +83,15 @@
8484 case 'clear_collection/':
8585 CollectionSession::clearCollection();
8686 $wgUser->invalidateCache();
87 - $wgOut->redirect( $wgRequest->getVal( 'return_to', SkinTemplate::makeSpecialUrl( 'Book' ) ) );
 87+ $redirect = $wgRequest->getVal( 'return_to' );
 88+ $redirectURL = SkinTemplate::makeSpecialUrl( 'Book' );
 89+ if ( !empty( $redirect ) ) {
 90+ $title = Title::newFromText( $redirect );
 91+ if ( !is_null( $title ) ) {
 92+ $redirectURL = $title->getFullURL();
 93+ }
 94+ }
 95+ $wgOut->redirect( $redirectURL );
8896 return;
8997 case 'set_titles/':
9098 self::setTitles( $wgRequest->getText( 'collectionTitle', '' ), $wgRequest->getText( 'collectionSubtitle', '') );

Status & tagging log