Page MenuHomePhabricator

SpecialTemplatePrefix.patch

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

SpecialTemplatePrefix.patch

Index: phase3/includes/Parser.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/Parser.php,v
retrieving revision 1.553
diff -u -r1.553 Parser.php
--- phase3/includes/Parser.php 30 Dec 2005 11:10:51 -0000 1.553
+++ phase3/includes/Parser.php 31 Dec 2005 19:05:30 -0000
@@ -2458,6 +2458,19 @@
}
}
+ # Variable/template prefix hooks
+ # $part1 is the name (foo:bar)
+ # $args is anything afterwards
+ # $hook_ret is your parsed value
+ # $noparse is whether we shouldn't parse further (default to fal
se)
+ # $nowiki is if the content isn't wikitext (default to false)
+ # We can't use the MagicWord pattern established above because we don't know which ones we should do.
+ $hook_ret = '';
+ if ( !$found && !wfRunHooks('ParserHandleSpecialPrefix', array($part1, $args, &$hook_ret, &$noparse, &$nowiki))) {
+ $text = $linestart . $hook_ret;
+ $found = true;
+ }
+
# Template table test
# Did we encounter this template already? If yes, it is in the cache
Index: phase3/includes/SpecialVersion.php
===================================================================
RCS file: /cvsroot/wikipedia/phase3/includes/SpecialVersion.php,v
retrieving revision 1.37
diff -u -r1.37 SpecialVersion.php
--- phase3/includes/SpecialVersion.php 29 Dec 2005 20:27:25 -0000 1.37
+++ phase3/includes/SpecialVersion.php 31 Dec 2005 19:05:30 -0000
@@ -100,6 +100,7 @@
'specialpage' => 'Special pages',
'parserhook' => 'Parser hooks',
'variable' => 'Variables',
+ 'prefix' => 'Special prefixes',
'other' => 'Other',
);
wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2095
Default Alt Text
SpecialTemplatePrefix.patch (2 KB)

Event Timeline