* @return string
*/
private function internalParseHalfParsed( $text, $isMain = true, $linestart = true ) {
- global $wgUseTidy, $wgAlwaysUseTidy;
-
$text = $this->mStripState->unstripGeneral( $text );
if ( $isMain ) {
$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
*/
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;
}
$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 );