them.
* Added new hook ChangePasswordForm to allow adding of additional fields in Special:ChangePassword
* Added new function getDomain to AuthPlugin for getting a user's domain
+* (bug 23427) New magic word {{PAGEID}} which gives the current page ID.
+ Will be null on previewing a page being created.
=== Bug fixes in 1.20 ===
* (bug 30245) Use the correct way to construct a log page title.
'numberoffiles',
'numberofedits',
'articlepath',
+ 'pageid',
'sitename',
'server',
'servername',
$subjPage = $this->mTitle->getSubjectPage();
$value = wfEscapeWikiText( $subjPage->getPrefixedUrl() );
break;
+ case 'pageid': // requested in bug 23427
+ $pageid = $this->getTitle()->getArticleId();
+ if( $pageid == 0 ) {
+ # 0 means the page doesn't exist in the database,
+ # which means the user is previewing a new page.
+ # The vary-revision flag must be set, because the magic word
+ # will have a different value once the page is saved.
+ $this->mOutput->setFlag( 'vary-revision' );
+ wfDebug( __METHOD__ . ": {{PAGEID}} used in a new page, setting vary-revision...\n" );
+ }
+ $value = $pageid ? $pageid : null;
+ break;
case 'revisionid':
# Let the edit saving system know we should parse the page
# *after* a revision ID has been assigned.
'nse' => array( 0, 'NSE:' ),
'localurl' => array( 0, 'LOCALURL:' ),
'localurle' => array( 0, 'LOCALURLE:' ),
- 'articlepath' => array( 0, 'ARTICLEPATH' ),
+ 'articlepath' => array( 0, 'ARTICLEPATH' ),
+ 'pageid' => array( 0, 'PAGEID' ),
'server' => array( 0, 'SERVER' ),
'servername' => array( 0, 'SERVERNAME' ),
'scriptpath' => array( 0, 'SCRIPTPATH' ),