Merge "Simplify HTMLTitleTextField::validate"
[lhc/web/wiklou.git] / includes / Storage / RevisionStoreRecord.php
index 341855d..6148c44 100644 (file)
@@ -81,7 +81,7 @@ class RevisionStoreRecord extends RevisionRecord {
                // allows rev_parent_id to be NULL.
                $this->mParentId = isset( $row->rev_parent_id ) ? intval( $row->rev_parent_id ) : null;
                $this->mSize = isset( $row->rev_len ) ? intval( $row->rev_len ) : null;
-               $this->mSha1 = isset( $row->rev_sha1 ) ? $row->rev_sha1 : null;
+               $this->mSha1 = !empty( $row->rev_sha1 ) ? $row->rev_sha1 : null;
 
                // NOTE: we must not call $this->mTitle->getLatestRevID() here, since the state of
                // page_latest may be in limbo during revision creation. In that case, calling
@@ -150,6 +150,7 @@ class RevisionStoreRecord extends RevisionRecord {
        }
 
        /**
+        * @throws RevisionAccessException if the size was unknown and could not be calculated.
         * @return string The nominal revision size, never null. May be computed on the fly.
         */
        public function getSize() {
@@ -163,6 +164,7 @@ class RevisionStoreRecord extends RevisionRecord {
        }
 
        /**
+        * @throws RevisionAccessException if the hash was unknown and could not be calculated.
         * @return string The revision hash, never null. May be computed on the fly.
         */
        public function getSha1() {
@@ -205,4 +207,13 @@ class RevisionStoreRecord extends RevisionRecord {
                return parent::getTimestamp();
        }
 
+       /**
+        * @see RevisionStore::isComplete
+        *
+        * @return bool always true.
+        */
+       public function isReadyForInsertion() {
+               return true;
+       }
+
 }