Svoboda
|
Graniru
|
BBC Russia
|
Golosameriki
|
Facebook
BBC Russian
Home
Phabricator
Search
Configure Global Search
Log In
Files
F6451
PATCH.safesubst
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:57 PM
2014-11-21 22:57:46 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
PATCH.safesubst
View Options
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 safesubst: causes this to fall through, so that the
+ # template will always be expanded whether or not we are in PST
+ $mwSafeSubst = MagicWord::get( 'safesubst' );
+ 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:' ),
+ 'safesubst' => array( 0, 'SAFESUBST:' ),
'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) safesubst: to allow substitution without breaking transclusion
=== Languages updated in 1.16 ===
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5991
Default Alt Text
PATCH.safesubst (2 KB)
Attached To
Mode
T24297: There should be syntax for substitution that doesn't break normal transclusion
Attached
Detach File
Event Timeline
Log In to Comment