* (bug 4783) : Fix for "{{ns:0}} does not render"
* Improved support for interwiki transclusion
* (bug 1850) Image link to nonexistent file fixed.
-* (bug 5167) Add {{SUBPAGENAME}} variable
+* (bug 5167) Add {{SUBPAGENAME}} and {{SUBPAGENAMEE}} variables
Upload:
* (bug 2527) Always set destination filename when new file is selected
'MAG_FULLPAGENAMEE',
'MAG_RAW',
'MAG_SUBPAGENAME',
+ 'MAG_SUBPAGENAMEE',
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordMagicWords', array( &$magicWords ) );
MAG_CURRENTWEEK,
MAG_CURRENTDOW,
MAG_REVISIONID,
- MAG_SUBPAGENAME
+ MAG_SUBPAGENAME,
+ MAG_SUBPAGENAMEE
);
if ( ! defined( 'MEDIAWIKI_INSTALL' ) )
wfRunHooks( 'MagicWordwgVariableIDs', array( &$wgVariableIDs ) );
return $this->mTitle->getPrefixedURL();
case MAG_SUBPAGENAME:
return $this->mTitle->getSubpageText();
+ case MAG_SUBPAGENAMEE:
+ return $this->mTitle->getSubpageUrlForm();
case MAG_REVISIONID:
return $this->mRevisionId;
case MAG_NAMESPACE:
return( $this->mTextform );
}
}
+
+ /**
+ * Get a URL-encoded form of the subpage text
+ * @return string URL-encoded subpage name
+ */
+ function getSubpageUrlForm() {
+ $text = $this->getSubpageText();
+ $text = wfUrlencode( str_replace( ' ', '_', $text ) );
+ $text = str_replace( '%28', '(', str_replace( '%29', ')', $text ) ); # Clean up the URL; per below, this might not be safe
+ return( $text );
+ }
/**
* Get a URL-encoded title (not an actual URL) including interwiki
MAG_NAMESPACEE => array( 1, 'NAMESPACEE' ),
MAG_FULLPAGENAME => array( 1, 'FULLPAGENAME' ),
MAG_FULLPAGENAMEE => array( 1, 'FULLPAGENAMEE' ),
- MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ),
+ MAG_SUBPAGENAME => array( 0, 'SUBPAGENAME' ),
+ MAG_SUBPAGENAMEE => array( 0, 'SUBPAGENAMEE' ),
MAG_MSG => array( 0, 'MSG:' ),
MAG_SUBST => array( 0, 'SUBST:' ),
MAG_MSGNW => array( 0, 'MSGNW:' ),