Index: trunk/phase3/includes/Parser.php |
— | — | @@ -2083,6 +2083,8 @@ |
2084 | 2084 | return $this->mTitle->getPrefixedURL(); |
2085 | 2085 | case MAG_SUBPAGENAME: |
2086 | 2086 | return $this->mTitle->getSubpageText(); |
| 2087 | + case MAG_SUBPAGENAMEE: |
| 2088 | + return $this->mTitle->getSubpageUrlForm(); |
2087 | 2089 | case MAG_REVISIONID: |
2088 | 2090 | return $this->mRevisionId; |
2089 | 2091 | case MAG_NAMESPACE: |
Index: trunk/phase3/includes/MagicWord.php |
— | — | @@ -71,6 +71,7 @@ |
72 | 72 | 'MAG_FULLPAGENAMEE', |
73 | 73 | 'MAG_RAW', |
74 | 74 | 'MAG_SUBPAGENAME', |
| 75 | + 'MAG_SUBPAGENAMEE', |
75 | 76 | ); |
76 | 77 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
77 | 78 | wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) ); |
— | — | @@ -103,7 +104,8 @@ |
104 | 105 | MAG_CURRENTWEEK, |
105 | 106 | MAG_CURRENTDOW, |
106 | 107 | MAG_REVISIONID, |
107 | | - MAG_SUBPAGENAME |
| 108 | + MAG_SUBPAGENAME, |
| 109 | + MAG_SUBPAGENAMEE |
108 | 110 | ); |
109 | 111 | if ( ! defined( 'MEDIAWIKI_INSTALL' ) ) |
110 | 112 | wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) ); |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -687,6 +687,17 @@ |
688 | 688 | return( $this->mTextform ); |
689 | 689 | } |
690 | 690 | } |
| 691 | + |
| 692 | + /** |
| 693 | + * Get a URL-encoded form of the subpage text |
| 694 | + * @return string URL-encoded subpage name |
| 695 | + */ |
| 696 | + function getSubpageUrlForm() { |
| 697 | + $text = $this->getSubpageText(); |
| 698 | + $text = wfUrlencode( str_replace( ' ', '_', $text ) ); |
| 699 | + $text = str_replace( '%28', '(', str_replace( '%29', ')', $text ) ); # Clean up the URL; per below, this might not be safe |
| 700 | + return( $text ); |
| 701 | + } |
691 | 702 | |
692 | 703 | /** |
693 | 704 | * Get a URL-encoded title (not an actual URL) including interwiki |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -292,7 +292,7 @@ |
293 | 293 | * (bug 4783) : Fix for "{{ns:0}} does not render" |
294 | 294 | * Improved support for interwiki transclusion |
295 | 295 | * (bug 1850) Image link to nonexistent file fixed. |
296 | | -* (bug 5167) Add {{SUBPAGENAME}} variable |
| 296 | +* (bug 5167) Add {{SUBPAGENAME}} and {{SUBPAGENAMEE}} variables |
297 | 297 | |
298 | 298 | Upload: |
299 | 299 | * (bug 2527) Always set destination filename when new file is selected |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -229,7 +229,8 @@ |
230 | 230 | MAG_NAMESPACEE => array( 1, 'NAMESPACEE' ), |
231 | 231 | MAG_FULLPAGENAME => array( 1, 'FULLPAGENAME' ), |
232 | 232 | MAG_FULLPAGENAMEE => array( 1, 'FULLPAGENAMEE' ), |
233 | | - MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ), |
| 233 | + MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ), |
| 234 | + MAG_SUBPAGENAMEE => array( 0, 'SUBPAGENAMEE' ), |
234 | 235 | MAG_MSG => array( 0, 'MSG:' ), |
235 | 236 | MAG_SUBST => array( 0, 'SUBST:' ), |
236 | 237 | MAG_MSGNW => array( 0, 'MSGNW:' ), |