X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FRevision.php;h=885544131066513061abdd6b647e1fdd6e51fc47;hp=bcfbe638b4b1c408f0057849fd9cebeaa95b6873;hb=288fb8cafaa14e5bacda9316536f36fe4425b8a4;hpb=c94ffdd2f901df2b39b44b25a4985102b2e2df98 diff --git a/includes/Revision.php b/includes/Revision.php index bcfbe638b4..8855441310 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -645,6 +645,10 @@ class Revision implements IDBAccessObject { # if we have a content object, use it to set the model and type if ( !empty( $row['content'] ) ) { + if ( !( $row['content'] instanceof Content ) ) { + throw new MWException( '`content` field must contain a Content object.' ); + } + // @todo when is that set? test with external store setup! check out insertOn() [dk] if ( !empty( $row['text_id'] ) ) { throw new MWException( "Text already stored in external store (id {$row['text_id']}), " . @@ -685,10 +689,6 @@ class Revision implements IDBAccessObject { // if we have a Content object, override mText and mContentModel if ( !empty( $row['content'] ) ) { - if ( !( $row['content'] instanceof Content ) ) { - throw new MWException( '`content` field must contain a Content object.' ); - } - $handler = $this->getContentHandler(); $this->mContent = $row['content'];