Index: trunk/extensions/Collection/Collection.hooks.php |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | array( 'onclick' => "if (confirm('$msg')) return true; else return false;", |
252 | 252 | 'rel' => 'nofollow', |
253 | 253 | 'title' => wfMsg( "coll-clear_collection_tooltip" ) ), |
254 | | - array( 'return_to' => $wgTitle->getFullURL() ), |
| 254 | + array( 'return_to' => $wgTitle->getPrefixedText() ), |
255 | 255 | array( 'known', 'noclasses' ) |
256 | 256 | ) |
257 | 257 | ); |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -83,7 +83,15 @@ |
84 | 84 | case 'clear_collection/': |
85 | 85 | CollectionSession::clearCollection(); |
86 | 86 | $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 ); |
88 | 96 | return; |
89 | 97 | case 'set_titles/': |
90 | 98 | self::setTitles( $wgRequest->getText( 'collectionTitle', '' ), $wgRequest->getText( 'collectionSubtitle', '') ); |