(bug 839) Add URLENCODE magic word

This commit is contained in:
Rob Church 2006-05-17 15:36:05 +00:00
parent fd7bca795a
commit e7f5589bfe
4 changed files with 13 additions and 0 deletions

View file

@ -286,6 +286,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
* (bug 6001) PAGENAMEE and FULLPAGENAMEE don't work in FULLURL and LOCALURL magic
words
* (bug 5958) Switch Uzbek language name to use latin script
* (bug 839) Add URLENCODE magic word
== Compatibility ==

View file

@ -88,6 +88,7 @@ $magicWords = array(
'MAG_CURRENTVERSION',
'MAG_BASEPAGENAME',
'MAG_BASEPAGENAMEE',
'MAG_URLENCODE',
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
@ -138,6 +139,7 @@ $wgVariableIDs = array(
MAG_CURRENTVERSION,
MAG_BASEPAGENAME,
MAG_BASEPAGENAMEE,
MAG_URLENCODE,
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );

View file

@ -2579,6 +2579,15 @@ class Parser
}
}
# URLENCODE
if( !$found ) {
$urlencode =& MagicWord::get( MAG_URLENCODE );
if( $urlencode->matchStartAndRemove( $part1 ) ) {
$text = $linestart . urlencode( $part1 );
$found = true;
}
}
# LCFIRST, UCFIRST, LC and UC
if ( !$found ) {
$lcfirst =& MagicWord::get( MAG_LCFIRST );

View file

@ -286,6 +286,7 @@ $wgLanguageNamesEn =& $wgLanguageNames;
MAG_RAWSUFFIX => array( 1, 'R' ),
MAG_NEWSECTIONLINK => array( 1, '__NEWSECTIONLINK__' ),
MAG_CURRENTVERSION => array( 1, 'CURRENTVERSION' ),
MAG_URLENCODE => array( 0, 'URLENCODE:' ),
);
if (!$wgCachedMessageArrays) {