Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F1316
Parser.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 6:57 PM
2014-11-21 18:57:51 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
Parser.diff
View Options
--- mediawiki-1.3.5/includes/Parser.php 2004-09-21 14:09:56.000000000 -0500
+++ wiki/includes/Parser.php 2004-10-12 01:57:54.000000000 -0500
@@ -1766,14 +1766,44 @@
if ( !$found && array_key_exists( $part1, $inputArgs ) ) {
$text = $inputArgs[$part1];
$found = true;
}
*/
- # Load from database
- if ( !$found ) {
+ # Load from MediaWiki
+ if ( !$found )
+ {
+ $title = Title::newFromText( $part1, NS_MEDIAWIKI );
+
+ if ( !is_null( $title ) && !$title->isExternal() )
+ {
+ # Check for excessive inclusion
+ $dbk = $title->getPrefixedDBkey();
+ if ( $this->incrementIncludeCount( $dbk ) ) {
+ $article = new Article( $title );
+ $articleContent = $article->getContentWithoutUsingSoManyDamnGlobals();
+ if ( $articleContent !== false ) {
+ $found = true;
+ $text = $articleContent;
+ $itcamefromthedatabase = true;
+ }
+ }
+
+ # If the title is valid but undisplayable, make a link to it
+ if ( $this->mOutputType == OT_HTML && !$found ) {
+ $text = '[[' . $title->getPrefixedText() . ']]';
+ $found = true;
+ }
+ }
+ }
+
+ # Load from Template
+ if ( !$found )
+ {
$title = Title::newFromText( $part1, NS_TEMPLATE );
- if ( !is_null( $title ) && !$title->isExternal() ) {
+
+ if ( !is_null( $title ) && !$title->isExternal() )
+ {
# Check for excessive inclusion
$dbk = $title->getPrefixedDBkey();
if ( $this->incrementIncludeCount( $dbk ) ) {
$article = new Article( $title );
$articleContent = $article->getContentWithoutUsingSoManyDamnGlobals();
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1215
Default Alt Text
Parser.diff (1 KB)
Attached To
Mode
T2694: Parser ignores custom MediaWiki templates
Attached
Detach File
Event Timeline
Log In to Comment