https://www.mediawiki.org/wiki/Special:Code/MediaWiki/111040
Revision: 111040 Author: ashley Date: 2012-02-09 14:53:16 +0000 (Thu, 09 Feb 2012) Log Message: ----------- 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: trunk/extensions/Comments/CommentClass.php =================================================================== --- trunk/extensions/Comments/CommentClass.php 2012-02-09 14:51:01 UTC (rev 111039) +++ trunk/extensions/Comments/CommentClass.php 2012-02-09 14:53:16 UTC (rev 111040) @@ -669,7 +669,7 @@ } function getVoteLink( $commentID, $voteType ) { - global $wgUser, $wgScriptPath; + global $wgUser, $wgScriptPath, $wgOut; // Blocked users cannot vote, obviously if( $wgUser->isBlocked() ) { @@ -684,7 +684,10 @@ } else { // Anonymous users need to log in before they can vote $login = SpecialPage::getTitleFor( 'Userlogin' ); - $voteLink .= "<a href=\"{$login->escapeFullURL()}\" rel=\"nofollow\">"; + $voteLink .= + "<a href=\"" . + $login->escapeLocalURL( array( 'returnto' => $wgOut->getTitle()->getDBkey() ) ) . + "\" rel=\"nofollow\">"; } $imagePath = $wgScriptPath . '/extensions/Comments/images'; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs