r16279 - Code Review

From MediaWiki.org

Jump to: navigation, search
Repository:MediaWiki
Revision:r16278 | r16279 (on ViewVC) | r16280 >
Date:07:51, 30 August 2006
Author:robchurch
Status:new
Tags:
Comment:* (bug 7059) Introduce "anchorencode" colon function
Modified paths:

Diff [purge]

Index: trunk/phase3/includes/Parser.php
===================================================================
--- trunk/phase3/includes/Parser.php	(revision 16278)
+++ trunk/phase3/includes/Parser.php	(revision 16279)
@@ -160,6 +160,7 @@
 		$this->setFunctionHook( 'language', array( 'CoreParserFunctions', 'language' ), SFH_NO_HASH );
 		$this->setFunctionHook( 'padleft', array( 'CoreParserFunctions', 'padleft' ), SFH_NO_HASH );
 		$this->setFunctionHook( 'padright', array( 'CoreParserFunctions', 'padright' ), SFH_NO_HASH );
+		$this->setFunctionHook( 'anchorencode', array( 'CoreParserFunctions', 'anchorencode' ), SFH_NO_HASH );
 
 		if ( $wgAllowDisplayTitle ) {
 			$this->setFunctionHook( 'displaytitle', array( 'CoreParserFunctions', 'displaytitle' ), SFH_NO_HASH );
Index: trunk/phase3/includes/CoreParserFunctions.php
===================================================================
--- trunk/phase3/includes/CoreParserFunctions.php	(revision 16278)
+++ trunk/phase3/includes/CoreParserFunctions.php	(revision 16279)
@@ -163,6 +163,10 @@
 		return self::pad( $string, $length, $char );
 	}
 	
+	function anchorencode( $parser, $text ) {
+		return str_replace( '%', '.', urlencode( $text ) );
+	}
+	
 }
 
 ?>
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES	(revision 16278)
+++ trunk/phase3/RELEASE-NOTES	(revision 16279)
@@ -162,6 +162,7 @@
 * (bug 366) Add local-system-timezone equivalents for date/time variables
 * (bug 7109) Fix Atom feed version number in header links
 * (bug 7075) List registered parser function hooks on Special:Version
+* (bug 7059) Introduce "anchorencode" colon function
 
 == Languages updated ==
 
Index: trunk/phase3/languages/MessagesEn.php
===================================================================
--- trunk/phase3/languages/MessagesEn.php	(revision 16278)
+++ trunk/phase3/languages/MessagesEn.php	(revision 16279)
@@ -283,6 +283,7 @@
 	'newsectionlink'         => array( 1,    '__NEWSECTIONLINK__'     ),
 	'currentversion'         => array( 1,    'CURRENTVERSION'         ),
 	'urlencode'              => array( 0,    'URLENCODE:'             ),
+	'anchorencode'			 => array( 0,	 'ANCHORENCODE'			  ),
 	'currenttimestamp'       => array( 1,    'CURRENTTIMESTAMP'       ),
 	'localtimestamp'         => array( 1,    'LOCALTIMESTAMP'         ),
 	'directionmark'          => array( 1,    'DIRECTIONMARK', 'DIRMARK' ),
Views
Toolbox