Made the "bypassCache" flag for file locator methods use the master DB
[lhc/web/wiklou.git] / includes / filerepo / file / OldLocalFile.php
index 73c614a..fd92e11 100644 (file)
@@ -175,10 +175,12 @@ class OldLocalFile extends LocalFile {
        }
 
        function loadFromDB( $flags = 0 ) {
-
                $this->dataLoaded = true;
 
-               $dbr = $this->repo->getSlaveDB();
+               $dbr = ( $flags & self::READ_LATEST )
+                       ? $this->repo->getMasterDB()
+                       : $this->repo->getSlaveDB();
+
                $conds = array( 'oi_name' => $this->getName() );
                if ( is_null( $this->requestedTime ) ) {
                        $conds['oi_archive_name'] = $this->archive_name;