Index: trunk/phase3/includes/parser/Parser.php
===================================================================
--- trunk/phase3/includes/parser/Parser.php (revision 38278)
+++ trunk/phase3/includes/parser/Parser.php (revision 38279)
@@ -3839,6 +3839,11 @@
$this->setOutputType = self::OT_PREPROCESS;
}
+ # Option to disable this feature
+ if ( !$this->mOptions->getCleanSignatures() ) {
+ return $text;
+ }
+
# FIXME: regex doesn't respect extension tags or nowiki
# => Move this logic to braceSubstitution()
$substWord = MagicWord::get( 'subst' );
Index: trunk/phase3/includes/parser/ParserOptions.php
===================================================================
--- trunk/phase3/includes/parser/ParserOptions.php (revision 38278)
+++ trunk/phase3/includes/parser/ParserOptions.php (revision 38279)
@@ -49,6 +49,7 @@
function getRemoveComments() { return $this->mRemoveComments; }
function getTemplateCallback() { return $this->mTemplateCallback; }
function getEnableLimitReport() { return $this->mEnableLimitReport; }
+ function getCleanSignatures() { return $this->mCleanSignatures; }
function getSkin() {
if ( !isset( $this->mSkin ) ) {
@@ -91,6 +92,7 @@
function setTemplateCallback( $x ) { return wfSetVar( $this->mTemplateCallback, $x ); }
function enableLimitReport( $x = true ) { return wfSetVar( $this->mEnableLimitReport, $x ); }
function setTimestamp( $x ) { return wfSetVar( $this->mTimestamp, $x ); }
+ function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); }
function __construct( $user = null ) {
$this->initialiseFromUser( $user );
@@ -108,7 +110,7 @@
function initialiseFromUser( $userInput ) {
global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages;
global $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion, $wgMaxArticleSize;
- global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth;
+ global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures;
$fname = 'ParserOptions::initialiseFromUser';
wfProfileIn( $fname );
if ( !$userInput ) {
@@ -144,6 +146,7 @@
$this->mRemoveComments = true;
$this->mTemplateCallback = array( 'Parser', 'statelessFetchTemplate' );
$this->mEnableLimitReport = false;
+ $this->mCleanSignatures = $wgCleanSignatures;
wfProfileOut( $fname );
}
}
Index: trunk/phase3/includes/DefaultSettings.php
===================================================================
--- trunk/phase3/includes/DefaultSettings.php (revision 38278)
+++ trunk/phase3/includes/DefaultSettings.php (revision 38279)
@@ -940,6 +940,11 @@
$wgMaxTemplateDepth = 40;
$wgMaxPPExpandDepth = 40;
+/**
+ * If true, removes (substitutes) templates in "~~~~" signatures.
+ */
+$wgCleanSignatures = true;
+
$wgExtraSubtitle = '';
$wgSiteSupportPage = ''; # A page where you users can receive donations
Index: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES (revision 38278)
+++ trunk/phase3/RELEASE-NOTES (revision 38279)
@@ -36,6 +36,8 @@
'EditSectionLinkForOther' hook has been removed, but 'EditSectionLink' is
run in all cases instead, so extensions using the old hooks should still work
if they ran roughly the same code for both hooks (as is almost certain).
+* Signature (~~~~) "cleaning", i.e. template removal, can be disabled with
+ $wgCleanSignatures=false
=== Bug fixes in 1.14 ===