From 3d920f00be3f6eb6fa8785b730f53d57a665cbdf Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 2 Dec 2014 00:35:47 +0000 Subject: [PATCH] WikiPage: Remove premature Content::isValid check Content classes that implement the isValid method are causing an "Internal error" to appear when saving from EditPage because WikiPage throws an exception that isn't handled anywhere. Turns out that ContentHandler already has infrastructure for this in place in Content::prepareSave (which returns a Status object with a relevant message informing the user), and WikiPage is actually calling this already right after this. Content::prepareSave defaults to using Content::isValid, so this code is simply obsolete and premature as it calls an internal method directly without handling it accordingly. Change-Id: I69f18d9e101c2261b0ff7bd1b0459ea7fdd7ae9f --- includes/page/WikiPage.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 61f0504e14..b99093cb27 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1831,11 +1831,6 @@ class WikiPage implements Page, IDBAccessObject { $changed = !$content->equals( $old_content ); if ( $changed ) { - if ( !$content->isValid() ) { - wfProfileOut( __METHOD__ ); - throw new MWException( "New content failed validity check!" ); - } - $dbw->begin( __METHOD__ ); try { -- 2.20.1