r111040 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111039‎ | r111040 | r111041 >
Date:14:53, 9 February 2012
Author:ashley
Status:ok
Tags:nodeploy 
Comment:
Comments: fix bug #34284 -- redirect the user to the page they came from by sticking the returnto parameter to the URL. Patch by Van de Bugger (with a minor correction by me).
Modified paths:
  • /trunk/extensions/Comments/CommentClass.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Comments/CommentClass.php
@@ -669,7 +669,7 @@
670670 }
671671
672672 function getVoteLink( $commentID, $voteType ) {
673 - global $wgUser, $wgScriptPath;
 673+ global $wgUser, $wgScriptPath, $wgOut;
674674
675675 // Blocked users cannot vote, obviously
676676 if( $wgUser->isBlocked() ) {
@@ -684,7 +684,10 @@
685685 } else {
686686 // Anonymous users need to log in before they can vote
687687 $login = SpecialPage::getTitleFor( 'Userlogin' );
688 - $voteLink .= "<a href=\"{$login->escapeFullURL()}\" rel=\"nofollow\">";
 688+ $voteLink .=
 689+ "<a href=\"" .
 690+ $login->escapeLocalURL( array( 'returnto' => $wgOut->getTitle()->getDBkey() ) ) .
 691+ "\" rel=\"nofollow\">";
689692 }
690693
691694 $imagePath = $wgScriptPath . '/extensions/Comments/images';

Status & tagging log