From 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 8 Dec 2013 09:55:49 +0100 Subject: Update to MediaWiki 1.22.0 --- includes/filerepo/file/ArchivedFile.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'includes/filerepo/file/ArchivedFile.php') diff --git a/includes/filerepo/file/ArchivedFile.php b/includes/filerepo/file/ArchivedFile.php index 3f786197..749f11a5 100644 --- a/includes/filerepo/file/ArchivedFile.php +++ b/includes/filerepo/file/ArchivedFile.php @@ -90,7 +90,7 @@ class ArchivedFile { $this->exists = false; $this->sha1 = ''; - if( $title instanceof Title ) { + if ( $title instanceof Title ) { $this->title = File::normalizeTitle( $title, 'exception' ); $this->name = $title->getDBkey(); } @@ -119,22 +119,22 @@ class ArchivedFile { } $conds = array(); - if( $this->id > 0 ) { + if ( $this->id > 0 ) { $conds['fa_id'] = $this->id; } - if( $this->key ) { + if ( $this->key ) { $conds['fa_storage_group'] = $this->group; $conds['fa_storage_key'] = $this->key; } - if( $this->title ) { + if ( $this->title ) { $conds['fa_name'] = $this->title->getDBkey(); } - if( !count( $conds ) ) { + if ( !count( $conds ) ) { throw new MWException( "No specific information for retrieving archived file" ); } - if( !$this->title || $this->title->getNamespace() == NS_FILE ) { + if ( !$this->title || $this->title->getNamespace() == NS_FILE ) { $this->dataLoaded = true; // set it here, to have also true on miss $dbr = wfGetDB( DB_SLAVE ); $row = $dbr->selectRow( @@ -196,6 +196,7 @@ class ArchivedFile { 'fa_user_text', 'fa_timestamp', 'fa_deleted', + 'fa_deleted_timestamp', /* Used by LocalFileRestoreBatch */ 'fa_sha1', ); } @@ -224,7 +225,7 @@ class ArchivedFile { $this->user_text = $row->fa_user_text; $this->timestamp = $row->fa_timestamp; $this->deleted = $row->fa_deleted; - if( isset( $row->fa_sha1 ) ) { + if ( isset( $row->fa_sha1 ) ) { $this->sha1 = $row->fa_sha1; } else { // old row, populate from key @@ -409,7 +410,7 @@ class ArchivedFile { */ public function getUser() { $this->load(); - if( $this->isDeleted( File::DELETED_USER ) ) { + if ( $this->isDeleted( File::DELETED_USER ) ) { return 0; } else { return $this->user; @@ -423,7 +424,7 @@ class ArchivedFile { */ public function getUserText() { $this->load(); - if( $this->isDeleted( File::DELETED_USER ) ) { + if ( $this->isDeleted( File::DELETED_USER ) ) { return 0; } else { return $this->user_text; @@ -437,7 +438,7 @@ class ArchivedFile { */ public function getDescription() { $this->load(); - if( $this->isDeleted( File::DELETED_COMMENT ) ) { + if ( $this->isDeleted( File::DELETED_COMMENT ) ) { return 0; } else { return $this->description; @@ -491,7 +492,7 @@ class ArchivedFile { */ public function isDeleted( $field ) { $this->load(); - return ($this->deleted & $field) == $field; + return ( $this->deleted & $field ) == $field; } /** -- cgit v1.2.3-54-g00ecf