* @throws MWException if the model id isn't known.
*/
public static function getLocalizedName( $name ) {
+ // Messages: content-model-wikitext, content-model-text,
+ // content-model-javascript, content-model-css
$key = "content-model-$name";
$msg = wfMessage( $key );
* @since 1.21
*
* @param Title $destination the page to redirect to.
+ * @param string $text text to include in the redirect, if possible.
*
* @return Content
*/
- public function makeRedirectContent( Title $destination ) {
+ public function makeRedirectContent( Title $destination, $text = '' ) {
return null;
}
$undo_content = $undo->getContent();
$undoafter_content = $undoafter->getContent();
+ if ( !$undo_content || !$undoafter_content ) {
+ return false; // no content to undo
+ }
+
$this->checkModelID( $cur_content->getModel() );
$this->checkModelID( $undo_content->getModel() );
$this->checkModelID( $undoafter_content->getModel() );
* @return ParserOptions
*/
public function makeParserOptions( $context ) {
- global $wgContLang;
+ global $wgContLang, $wgEnableParserLimitReporting;
if ( $context instanceof IContextSource ) {
$options = ParserOptions::newFromContext( $context );
throw new MWException( "Bad context for parser options: $context" );
}
- $options->enableLimitReport(); // show inclusion/loop reports
+ $options->enableLimitReport( $wgEnableParserLimitReporting ); // show inclusion/loop reports
$options->setTidy( true ); // fix bad HTML
return $options;