Page MenuHomePhabricator

PATCH.substifsubsted

Authored By
bzimport
Nov 21 2014, 10:57 PM
Size
2 KB
Referenced Files
None
Subscribers
None

PATCH.substifsubsted

Index: includes/parser/Parser.php
===================================================================
--- includes/parser/Parser.php (revision 61632)
+++ includes/parser/Parser.php (working copy)
@@ -2796,15 +2796,22 @@
# SUBST
wfProfileIn( __METHOD__.'-modifiers' );
if ( !$found ) {
- $mwSubst = MagicWord::get( 'subst' );
- if ( $mwSubst->matchStartAndRemove( $part1 ) xor $this->ot['wiki'] ) {
- # One of two possibilities is true:
- # 1) Found SUBST but not in the PST phase
- # 2) Didn't find SUBST and in the PST phase
- # In either case, return without further processing
- $text = $frame->virtualBracketedImplode( '{{', '|', '}}', $titleWithSpaces, $args );
- $isLocalObj = true;
- $found = true;
+
+ # Matching subst-if-: causes this to fall through, so that the
+ # template will always be expanded whether or not we are in PST
+ $mwSafeSubst = MagicWord::get( 'subst_if_substed' );
+ if ( !$mwSafeSubst->matchStartAndRemove( $part1 ) ) {
+
+ $mwSubst = MagicWord::get( 'subst' );
+ if ( $mwSubst->matchStartAndRemove( $part1 ) xor $this->ot['wiki'] ) {
+ # One of two possibilities is true:
+ # 1) Found SUBST but not in the PST phase
+ # 2) Didn't find SUBST and in the PST phase
+ # In either case, return without further processing
+ $text = $frame->virtualBracketedImplode( '{{', '|', '}}', $titleWithSpaces, $args );
+ $isLocalObj = true;
+ $found = true;
+ }
}
}
Index: languages/messages/MessagesEn.php
===================================================================
--- languages/messages/MessagesEn.php (revision 61620)
+++ languages/messages/MessagesEn.php (working copy)
@@ -265,6 +265,7 @@
'subjectpagenamee' => array( 1, 'SUBJECTPAGENAMEE', 'ARTICLEPAGENAMEE' ),
'msg' => array( 0, 'MSG:' ),
'subst' => array( 0, 'SUBST:' ),
+ 'subst_if_substed' => array( 0, 'subst-if-substed:', 'substifsubsted:' ),
'msgnw' => array( 0, 'MSGNW:' ),
'img_thumbnail' => array( 1, 'thumbnail', 'thumb' ),
'img_manualthumb' => array( 1, 'thumbnail=$1', 'thumb=$1'),
Index: RELEASE-NOTES
===================================================================
--- RELEASE-NOTES (revision 61620)
+++ RELEASE-NOTES (working copy)
@@ -804,6 +804,7 @@
* (bug 22248) Output extension URLs in meta=siteinfo&siprop=extensions
* Support key-params arrays in 'descriptionmsg' in meta=siteinfo&siprop=extensions
* (bug 21922) YAML output should quote asterisk when used as key
+* (bug 22297) subst-if-substed: to allow substitution without breaking transclusion
=== Languages updated in 1.16 ===

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5992
Default Alt Text
PATCH.substifsubsted (2 KB)

Event Timeline