X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fparser%2FParser.php;h=677da63bd7d3bc51e10b7cf5d1249406d3ade11a;hp=3d5d23e5e7243349a26da8e914f47c69446dfe42;hb=f8659ae6ea90d7bc8ce28bfc1caa56153878836f;hpb=a7c124f2e96a13464e51cb2ec9885f2d42357f57 diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 3d5d23e5e7..677da63bd7 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -509,6 +509,9 @@ class Parser { if ( $wgShowHostnames ) { $limitReport .= 'Parsed by ' . wfHostname() . "\n"; } + $limitReport .= 'Cached time: ' . $this->mOutput->getCacheTime() . "\n"; + $limitReport .= 'Cache expiry: ' . $this->mOutput->getCacheExpiry() . "\n"; + $limitReport .= 'Dynamic content: ' . ( $this->mOutput->hasDynamicContent() ? 'true' : 'false' ) . "\n"; foreach ( $this->mOutput->getLimitReportData() as $key => $value ) { if ( Hooks::run( 'ParserLimitReportFormat', array( $key, &$value, &$limitReport, false, false ) @@ -1280,8 +1283,6 @@ class Parser { * @return string */ private function internalParseHalfParsed( $text, $isMain = true, $linestart = true ) { - global $wgUseTidy, $wgAlwaysUseTidy; - $text = $this->mStripState->unstripGeneral( $text ); if ( $isMain ) { @@ -1332,7 +1333,7 @@ class Parser { $text = Sanitizer::normalizeCharReferences( $text ); - if ( ( $wgUseTidy && $this->mOptions->getTidy() ) || $wgAlwaysUseTidy ) { + if ( MWTidy::isEnabled() && $this->mOptions->getTidy() ) { $text = MWTidy::tidy( $text ); } else { # attempt to sanitize at least some nesting problems @@ -3323,7 +3324,8 @@ class Parser { */ public function replaceVariables( $text, $frame = false, $argsOnly = false ) { # Is there any text? Also, Prevent too big inclusions! - if ( strlen( $text ) < 1 || strlen( $text ) > $this->mOptions->getMaxIncludeSize() ) { + $textSize = strlen( $text ); + if ( $textSize < 1 || $textSize > $this->mOptions->getMaxIncludeSize() ) { return $text; } @@ -5324,6 +5326,7 @@ class Parser { $ig->setParser( $this ); $ig->setHideBadImages(); $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) ); + $this->getOutput()->addModuleStyles( 'mediawiki.page.gallery.styles' ); if ( isset( $params['showfilename'] ) ) { $ig->setShowFilename( true );