Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2579,6 +2579,15 @@ |
2580 | 2580 | } |
2581 | 2581 | } |
2582 | 2582 | |
| 2583 | + # URLENCODE |
| 2584 | + if( !$found ) { |
| 2585 | + $urlencode =& MagicWord::get( MAG_URLENCODE ); |
| 2586 | + if( $urlencode->matchStartAndRemove( $part1 ) ) { |
| 2587 | + $text = $linestart . urlencode( $part1 ); |
| 2588 | + $found = true; |
| 2589 | + } |
| 2590 | + } |
| 2591 | + |
2583 | 2592 | # LCFIRST, UCFIRST, LC and UC |
2584 | 2593 | if ( !$found ) { |
2585 | 2594 | $lcfirst =& MagicWord::get( MAG_LCFIRST ); |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -88,6 +88,7 @@ |
89 | 89 | 'MAG_CURRENTVERSION', |
90 | 90 | 'MAG_BASEPAGENAME', |
91 | 91 | 'MAG_BASEPAGENAMEE', |
| 92 | + 'MAG_URLENCODE', |
92 | 93 | ); |
93 | 94 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
94 | 95 | wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) ); |
— | — | @@ -138,6 +139,7 @@ |
139 | 140 | MAG_CURRENTVERSION, |
140 | 141 | MAG_BASEPAGENAME, |
141 | 142 | MAG_BASEPAGENAMEE, |
| 143 | + MAG_URLENCODE, |
142 | 144 | ); |
143 | 145 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
144 | 146 | wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -286,6 +286,7 @@ |
287 | 287 | * (bug 6001) PAGENAMEE and FULLPAGENAMEE don't work in FULLURL and LOCALURL magic |
288 | 288 | words |
289 | 289 | * (bug 5958) Switch Uzbek language name to use latin script |
| 290 | +* (bug 839) Add URLENCODE magic word |
290 | 291 | |
291 | 292 | == Compatibility == |
292 | 293 | |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -286,6 +286,7 @@ |
287 | 287 | MAG_RAWSUFFIX => array( 1, 'R' ), |
288 | 288 | MAG_NEWSECTIONLINK => array( 1, '__NEWSECTIONLINK__' ), |
289 | 289 | MAG_CURRENTVERSION => array( 1, 'CURRENTVERSION' ), |
| 290 | + MAG_URLENCODE => array( 0, 'URLENCODE:' ), |
290 | 291 | ); |
291 | 292 | |
292 | 293 | if (!$wgCachedMessageArrays) { |