r13433 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13432‎ | r13433 | r13434 >
Date:16:19, 2 April 2006
Author:robchurch
Status:old
Tags:
Comment:
(bug 5167) Add SUBPAGENAMEE
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/MagicWord.php (modified) (history)
  • /trunk/phase3/includes/Parser.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Parser.php
@@ -2083,6 +2083,8 @@
20842084 return $this->mTitle->getPrefixedURL();
20852085 case MAG_SUBPAGENAME:
20862086 return $this->mTitle->getSubpageText();
 2087+ case MAG_SUBPAGENAMEE:
 2088+ return $this->mTitle->getSubpageUrlForm();
20872089 case MAG_REVISIONID:
20882090 return $this->mRevisionId;
20892091 case MAG_NAMESPACE:
Index: trunk/phase3/includes/MagicWord.php
@@ -71,6 +71,7 @@
7272 'MAG_FULLPAGENAMEE',
7373 'MAG_RAW',
7474 'MAG_SUBPAGENAME',
 75+ 'MAG_SUBPAGENAMEE',
7576 );
7677 if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
7778 wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
@@ -103,7 +104,8 @@
104105 MAG_CURRENTWEEK,
105106 MAG_CURRENTDOW,
106107 MAG_REVISIONID,
107 - MAG_SUBPAGENAME
 108+ MAG_SUBPAGENAME,
 109+ MAG_SUBPAGENAMEE
108110 );
109111 if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
110112 wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );
Index: trunk/phase3/includes/Title.php
@@ -687,6 +687,17 @@
688688 return( $this->mTextform );
689689 }
690690 }
 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+ }
691702
692703 /**
693704 * Get a URL-encoded title (not an actual URL) including interwiki
Index: trunk/phase3/RELEASE-NOTES
@@ -292,7 +292,7 @@
293293 * (bug 4783) : Fix for "{{ns:0}} does not render"
294294 * Improved support for interwiki transclusion
295295 * (bug 1850) Image link to nonexistent file fixed.
296 -* (bug 5167) Add {{SUBPAGENAME}} variable
 296+* (bug 5167) Add {{SUBPAGENAME}} and {{SUBPAGENAMEE}} variables
297297
298298 Upload:
299299 * (bug 2527) Always set destination filename when new file is selected
Index: trunk/phase3/languages/Language.php
@@ -229,7 +229,8 @@
230230 MAG_NAMESPACEE => array( 1, 'NAMESPACEE' ),
231231 MAG_FULLPAGENAME => array( 1, 'FULLPAGENAME' ),
232232 MAG_FULLPAGENAMEE => array( 1, 'FULLPAGENAMEE' ),
233 - MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ),
 233+ MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ),
 234+ MAG_SUBPAGENAMEE => array( 0, 'SUBPAGENAMEE' ),
234235 MAG_MSG => array( 0, 'MSG:' ),
235236 MAG_SUBST => array( 0, 'SUBST:' ),
236237 MAG_MSGNW => array( 0, 'MSGNW:' ),

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r13166(bug 5167) Add {{SUBPAGENAME}} variablerobchurch23:29, 4 March 2006

Status & tagging log