From: jenkins-bot
Date: Thu, 2 Jun 2016 21:23:04 +0000 (+0000)
Subject: Merge "Show ParserOutput warning instead of on the actual page output for ignored...
X-Git-Tag: 1.31.0-rc.0~6721
X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=089612544da3abd89476f41476abc78b0cd98e98;hp=-c;p=lhc%2Fweb%2Fwiklou.git
Merge "Show ParserOutput warning instead of on the actual page output for ignored display titles"
---
089612544da3abd89476f41476abc78b0cd98e98
diff --combined includes/parser/CoreParserFunctions.php
index 6b847e5c23,1718557ab4..01cce028a2
--- a/includes/parser/CoreParserFunctions.php
+++ b/includes/parser/CoreParserFunctions.php
@@@ -460,14 -460,14 +460,14 @@@ class CoreParserFunctions
return '';
}
} else {
- $parser->addTrackingCategory( 'restricted-displaytitle-ignored' );
$converter = $parser->getConverterLanguage()->getConverter();
- return '' .
+ $parser->getOutput()->addWarning(
wfMessage( 'restricted-displaytitle',
// Message should be parsed, but this param should only be escaped.
$converter->markNoConversion( wfEscapeWikiText( $text ) )
- )->inContentLanguage()->text() .
- '';
+ )->text()
+ );
+ $parser->addTrackingCategory( 'restricted-displaytitle-ignored' );
}
}
@@@ -775,10 -775,6 +775,10 @@@
// fetch revision from cache/database and return the value
$rev = self::getCachedRevisionObject( $parser, $title );
$length = $rev ? $rev->getSize() : 0;
+ if ( $length === null ) {
+ // We've had bugs where rev_len was not being recorded for empty pages, see T135414
+ $length = 0;
+ }
return self::formatRaw( $length, $raw );
}
diff --combined tests/parser/parserTests.txt
index 2f5450c91c,785791e11b..6c3841dccc
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@@ -2269,11 -2269,9 +2269,11 @@@ Entities inside inside of #tag:pre
!! wikitext
{{#tag:pre|Foo →bar}}
-!! html
+!! html/php
Foo →bar
+!! html/parsoid
+Foo âbar
!! end
!! test
@@@ -2824,7 -2822,7 +2824,7 @@@ parsoi
!! wikitext
{{echo|[{{fullurl:{{FULLPAGENAME}}|action=edit}} bar]}}
!! html
-[Main Page bar]
+[Main_Page bar]
!! end
!! test
@@@ -4782,15 -4780,6 +4782,15 @@@ ok-link, and another link.
+
+!!end
+
!! test
External image
!! wikitext
@@@ -7500,7 -7489,7 +7500,7 @@@ Example for such a section: == < =
#<#>
!! html/parsoid
-#<#>
+#<#>
!! end
!! test
@@@ -9951,7 -9940,7 +9951,7 @@@ Parsoid: Page property magic word with
!! wikitext
{{DISPLAYTITLE:''{{PAGENAME}}''}}
!! html/parsoid
-
+
!! end
!! test
@@@ -13964,7 -13953,7 +13964,7 @@@ Redirected imag
!! wikitext
[[Image:Barfoo.jpg]]
!! html/php
-File:Barfoo.jpg
+
File:Barfoo.jpg
!! end
@@@ -20666,7 -20655,6 +20666,6 @@@ this is not the the titl
!! html/php
Screen
this is not the the title
- Warning: Display title "whatever" was ignored since it is not equivalent to the page's actual title.
!! end