Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -3839,6 +3839,11 @@ |
3840 | 3840 | $this->setOutputType = self::OT_PREPROCESS; |
3841 | 3841 | } |
3842 | 3842 | |
| 3843 | + # Option to disable this feature |
| 3844 | + if ( !$this->mOptions->getCleanSignatures() ) { |
| 3845 | + return $text; |
| 3846 | + } |
| 3847 | + |
3843 | 3848 | # FIXME: regex doesn't respect extension tags or nowiki |
3844 | 3849 | # => Move this logic to braceSubstitution() |
3845 | 3850 | $substWord = MagicWord::get( 'subst' ); |
Index: trunk/phase3/includes/parser/ParserOptions.php |
— | — | @@ -49,6 +49,7 @@ |
50 | 50 | function getRemoveComments() { return $this->mRemoveComments; } |
51 | 51 | function getTemplateCallback() { return $this->mTemplateCallback; } |
52 | 52 | function getEnableLimitReport() { return $this->mEnableLimitReport; } |
| 53 | + function getCleanSignatures() { return $this->mCleanSignatures; } |
53 | 54 | |
54 | 55 | function getSkin() { |
55 | 56 | if ( !isset( $this->mSkin ) ) { |
— | — | @@ -91,6 +92,7 @@ |
92 | 93 | function setTemplateCallback( $x ) { return wfSetVar( $this->mTemplateCallback, $x ); } |
93 | 94 | function enableLimitReport( $x = true ) { return wfSetVar( $this->mEnableLimitReport, $x ); } |
94 | 95 | function setTimestamp( $x ) { return wfSetVar( $this->mTimestamp, $x ); } |
| 96 | + function setCleanSignatures( $x ) { return wfSetVar( $this->mCleanSignatures, $x ); } |
95 | 97 | |
96 | 98 | function __construct( $user = null ) { |
97 | 99 | $this->initialiseFromUser( $user ); |
— | — | @@ -108,7 +110,7 @@ |
109 | 111 | function initialiseFromUser( $userInput ) { |
110 | 112 | global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages; |
111 | 113 | global $wgAllowExternalImagesFrom, $wgAllowSpecialInclusion, $wgMaxArticleSize; |
112 | | - global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth; |
| 114 | + global $wgMaxPPNodeCount, $wgMaxTemplateDepth, $wgMaxPPExpandDepth, $wgCleanSignatures; |
113 | 115 | $fname = 'ParserOptions::initialiseFromUser'; |
114 | 116 | wfProfileIn( $fname ); |
115 | 117 | if ( !$userInput ) { |
— | — | @@ -144,6 +146,7 @@ |
145 | 147 | $this->mRemoveComments = true; |
146 | 148 | $this->mTemplateCallback = array( 'Parser', 'statelessFetchTemplate' ); |
147 | 149 | $this->mEnableLimitReport = false; |
| 150 | + $this->mCleanSignatures = $wgCleanSignatures; |
148 | 151 | wfProfileOut( $fname ); |
149 | 152 | } |
150 | 153 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -940,6 +940,11 @@ |
941 | 941 | $wgMaxTemplateDepth = 40; |
942 | 942 | $wgMaxPPExpandDepth = 40; |
943 | 943 | |
| 944 | +/** |
| 945 | + * If true, removes (substitutes) templates in "~~~~" signatures. |
| 946 | + */ |
| 947 | +$wgCleanSignatures = true; |
| 948 | + |
944 | 949 | $wgExtraSubtitle = ''; |
945 | 950 | $wgSiteSupportPage = ''; # A page where you users can receive donations |
946 | 951 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -36,6 +36,8 @@ |
37 | 37 | 'EditSectionLinkForOther' hook has been removed, but 'EditSectionLink' is |
38 | 38 | run in all cases instead, so extensions using the old hooks should still work |
39 | 39 | if they ran roughly the same code for both hooks (as is almost certain). |
| 40 | +* Signature (~~~~) "cleaning", i.e. template removal, can be disabled with |
| 41 | + $wgCleanSignatures=false |
40 | 42 | |
41 | 43 | === Bug fixes in 1.14 === |
42 | 44 | |