Merge "Improved some thumb.php error messages."
[lhc/web/wiklou.git] / includes / Revision.php
index fd356e1..5f62e4d 100644 (file)
@@ -493,13 +493,13 @@ class Revision implements IDBAccessObject {
                        $this->mTimestamp =         $row->rev_timestamp;
                        $this->mDeleted   = intval( $row->rev_deleted );
 
-                       if( !isset( $row->rev_parent_id ) ) {
-                               $this->mParentId = is_null( $row->rev_parent_id ) ? null : 0;
+                       if ( !isset( $row->rev_parent_id ) ) {
+                               $this->mParentId = null;
                        } else {
                                $this->mParentId  = intval( $row->rev_parent_id );
                        }
 
-                       if( !isset( $row->rev_len ) || is_null( $row->rev_len ) ) {
+                       if ( !isset( $row->rev_len ) ) {
                                $this->mSize = null;
                        } else {
                                $this->mSize = intval( $row->rev_len );
@@ -1148,9 +1148,13 @@ class Revision implements IDBAccessObject {
          *
          * @param $row Object: the text data
          * @param $prefix String: table prefix (default 'old_')
+         * @param $wiki String|false: the name of the wiki to load the revision text from
+         *         (same as the the wiki $row was loaded from) or false to indicate the local
+         *         wiki (this is the default). Otherwise, it must be a symbolic wiki database
+         *         identifier as understood by the LoadBalancer class.
          * @return String: text the text requested or false on failure
          */
-       public static function getRevisionText( $row, $prefix = 'old_' ) {
+       public static function getRevisionText( $row, $prefix = 'old_', $wiki = false ) {
                wfProfileIn( __METHOD__ );
 
                # Get data
@@ -1178,7 +1182,7 @@ class Revision implements IDBAccessObject {
                                wfProfileOut( __METHOD__ );
                                return false;
                        }
-                       $text = ExternalStore::fetchFromURL( $url );
+                       $text = ExternalStore::fetchFromURL( $url, array( 'wiki' => $wiki ) );
                }
 
                // If the text was fetched without an error, convert it
@@ -1404,11 +1408,7 @@ class Revision implements IDBAccessObject {
         * Lazy-load the revision's text.
         * Currently hardcoded to the 'text' table storage engine.
         *
-<<<<<<< HEAD
-        * @return String|boolean the revision text, or false on failure
-=======
         * @return String|bool the revision's text, or false on failure
->>>>>>> (Bug 41244) Gracefully handle failure to load text blob.
         */
        protected function loadText() {
                wfProfileIn( __METHOD__ );