r11105 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11104‎ | r11105 | r11106 >
Date:12:10, 23 September 2005
Author:timstarling
Status:old
Tags:
Comment:
added {{fullurl:}} and {{fullurle:}} functions
Modified paths:
  • /trunk/phase3/includes/MagicWord.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -2139,20 +2139,27 @@
21402140 }
21412141 }
21422142
2143 - # LOCALURL and LOCALURLE
 2143+ # LOCALURL and FULLURL
21442144 if ( !$found ) {
2145 - $mwLocal = MagicWord::get( MAG_LOCALURL );
2146 - $mwLocalE = MagicWord::get( MAG_LOCALURLE );
 2145+ $mwLocal =& MagicWord::get( MAG_LOCALURL );
 2146+ $mwLocalE =& MagicWord::get( MAG_LOCALURLE );
 2147+ $mwFull =& MagicWord::get( MAG_FULLURL );
 2148+ $mwFullE =& MagicWord::get( MAG_FULLURLE );
 2149+
21472150
21482151 if ( $mwLocal->matchStartAndRemove( $part1 ) ) {
21492152 $func = 'getLocalURL';
21502153 } elseif ( $mwLocalE->matchStartAndRemove( $part1 ) ) {
21512154 $func = 'escapeLocalURL';
 2155+ } elseif ( $mwFull->matchStartAndRemove( $part1 ) ) {
 2156+ $func = 'getFullURL';
 2157+ } elseif ( $mwFullE->matchStartAndRemove( $part1 ) ) {
 2158+ $func = 'escapeFullURL';
21522159 } else {
2153 - $func = '';
 2160+ $func = false;
21542161 }
21552162
2156 - if ( $func !== '' ) {
 2163+ if ( $func !== false ) {
21572164 $title = Title::newFromText( $part1 );
21582165 if ( !is_null( $title ) ) {
21592166 if ( $argc > 0 ) {
Index: trunk/phase3/includes/MagicWord.php
@@ -57,6 +57,8 @@
5858 define('MAG_NUMBEROFFILES', 43);
5959 define('MAG_IMG_MANUALTHUMB', 44);
6060 define('MAG_PLURAL', 45);
 61+define('MAG_FULLURL', 46);
 62+define('MAG_FULLURLE', 47);
6163
6264 $wgVariableIDs = array(
6365 MAG_CURRENTMONTH,
Index: trunk/phase3/languages/Language.php
@@ -234,6 +234,8 @@
235235 MAG_CURRENTDOW => array( 1, 'CURRENTDOW' ),
236236 MAG_REVISIONID => array( 1, 'REVISIONID' ),
237237 MAG_PLURAL => array( 0, 'PLURAL:' ),
 238+ MAG_FULLURL => array( 0, 'FULLURL:' ),
 239+ MAG_FULLURLE => array( 0, 'FULLURLE:' ),
238240 );
239241
240242 #-------------------------------------------------------------------

Status & tagging log