r16279 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16278‎ | r16279 | r16280 >
Date:07:51, 30 August 2006
Author:robchurch
Status:old
Tags:
Comment:
* (bug 7059) Introduce "anchorencode" colon function
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/CoreParserFunctions.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/languages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/languages/MessagesEn.php
@@ -283,6 +283,7 @@
284284 'newsectionlink' => array( 1, '__NEWSECTIONLINK__' ),
285285 'currentversion' => array( 1, 'CURRENTVERSION' ),
286286 'urlencode' => array( 0, 'URLENCODE:' ),
 287+ 'anchorencode' => array( 0, 'ANCHORENCODE' ),
287288 'currenttimestamp' => array( 1, 'CURRENTTIMESTAMP' ),
288289 'localtimestamp' => array( 1, 'LOCALTIMESTAMP' ),
289290 'directionmark' => array( 1, 'DIRECTIONMARK', 'DIRMARK' ),
Index: trunk/phase3/RELEASE-NOTES
@@ -162,6 +162,7 @@
163163 * (bug 366) Add local-system-timezone equivalents for date/time variables
164164 * (bug 7109) Fix Atom feed version number in header links
165165 * (bug 7075) List registered parser function hooks on Special:Version
 166+* (bug 7059) Introduce "anchorencode" colon function
166167
167168 == Languages updated ==
168169
Index: trunk/phase3/includes/CoreParserFunctions.php
@@ -163,6 +163,10 @@
164164 return self::pad( $string, $length, $char );
165165 }
166166
 167+ function anchorencode( $parser, $text ) {
 168+ return str_replace( '%', '.', urlencode( $text ) );
 169+ }
 170+
167171 }
168172
169173 ?>
Index: trunk/phase3/includes/Parser.php
@@ -160,6 +160,7 @@
161161 $this->setFunctionHook( 'language', array( 'CoreParserFunctions', 'language' ), SFH_NO_HASH );
162162 $this->setFunctionHook( 'padleft', array( 'CoreParserFunctions', 'padleft' ), SFH_NO_HASH );
163163 $this->setFunctionHook( 'padright', array( 'CoreParserFunctions', 'padright' ), SFH_NO_HASH );
 164+ $this->setFunctionHook( 'anchorencode', array( 'CoreParserFunctions', 'anchorencode' ), SFH_NO_HASH );
164165
165166 if ( $wgAllowDisplayTitle ) {
166167 $this->setFunctionHook( 'displaytitle', array( 'CoreParserFunctions', 'displaytitle' ), SFH_NO_HASH );

Follow-up revisions

RevisionCommit summaryAuthorDate
r16675(bug 7059) 'anchorencode' colon function needs one more replace '+' -> '_'collinj18:24, 27 September 2006