* @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 );
$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() );