Merge "mediawiki.page.patrol.ajax: Rename file to match module name"
[lhc/web/wiklou.git] / includes / Revision.php
index a498817..1d7ac72 100644 (file)
@@ -1505,11 +1505,18 @@ class Revision implements IDBAccessObject {
                }
 
                $content = $this->getContent( Revision::RAW );
+               $prefixedDBkey = $title->getPrefixedDBkey();
+               $revId = $this->mId;
 
-               if ( !$content || !$content->isValid() ) {
-                       $t = $title->getPrefixedDBkey();
-
-                       throw new MWException( "Content of $t is not valid! Content model is $model" );
+               if ( !$content ) {
+                       throw new MWException(
+                               "Content of revision $revId ($prefixedDBkey) could not be loaded for validation!"
+                       );
+               }
+               if ( !$content->isValid() ) {
+                       throw new MWException(
+                               "Content of revision $revId ($prefixedDBkey) is not valid! Content model is $model"
+                       );
                }
        }
 
@@ -1519,7 +1526,7 @@ class Revision implements IDBAccessObject {
         * @return string
         */
        public static function base36Sha1( $text ) {
-               return wfBaseConvert( sha1( $text ), 16, 36, 31 );
+               return Wikimedia\base_convert( sha1( $text ), 16, 36, 31 );
        }
 
        /**