used for that. Rather, setRef() existed as memory optimisation for PHP 4.
* Passing false to ParserOptions::setWrapOutputClass() is deprecated. Use the
'unwrap' transform to ParserOutput::getText() instead.
+* ParserOutput objects generated using a non-default value for
+ ParserOptions::setWrapOutputClass() can no longer be added to the parser
+ cache.
== Compatibility ==
MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported,
'stubthreshold' => true,
'printable' => true,
'userlang' => true,
- 'wrapclass' => true,
];
/**
/**
* CSS class to use to wrap output from Parser::parse()
* @since 1.30
- * @param string|bool $className Set false to disable wrapping.
- * Passing false is deprecated since MediaWiki 1.31
+ * @param string $className Class name to use for wrapping.
+ * Passing false to indicate "no wrapping" was deprecated in MediaWiki 1.31.
* @return string|bool Current value
*/
public function setWrapOutputClass( $className ) {
if ( $className === true ) { // DWIM, they probably want the default class name
$className = 'mw-parser-output';
}
+ if ( $className === false ) {
+ wfDeprecated( __METHOD__ . '( false )', '1.31' );
+ }
return $this->setOption( 'wrapclass', $className );
}
'stubthreshold' => true,
'printable' => true,
'userlang' => true,
- 'wrapclass' => true,
];
}
'Non-in-key options are not ok' => [ false, [
'removeComments' => false,
] ],
+ 'Non-in-key options are not ok (2)' => [ false, [
+ 'wrapclass' => 'foobar',
+ ] ],
'Canonical override, not default (1)' => [ true, [
'tidy' => true,
] ],
$wgHooks['ParserOptionsRegister'] = [];
$this->assertSame( [
'dateformat', 'numberheadings', 'printable', 'stubthreshold',
- 'thumbsize', 'userlang', 'wrapclass',
+ 'thumbsize', 'userlang'
], ParserOptions::allCacheVaryingOptions() );
self::clearCache();
};
$this->assertSame( [
'dateformat', 'foo', 'numberheadings', 'printable', 'stubthreshold',
- 'thumbsize', 'userlang', 'wrapclass',
+ 'thumbsize', 'userlang'
], ParserOptions::allCacheVaryingOptions() );
}