dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Web installer: Correctly escape U+00A0 NO-BREAK SPACE"
[lhc/web/wiklou.git]
/
includes
/
Storage
/
RevisionArchiveRecord.php
diff --git
a/includes/Storage/RevisionArchiveRecord.php
b/includes/Storage/RevisionArchiveRecord.php
index
419cb95
..
213ee3c
100644
(file)
--- a/
includes/Storage/RevisionArchiveRecord.php
+++ b/
includes/Storage/RevisionArchiveRecord.php
@@
-67,6
+67,9
@@
class RevisionArchiveRecord extends RevisionRecord {
parent::__construct( $title, $slots, $wikiId );
Assert::parameterType( 'object', $row, '$row' );
parent::__construct( $title, $slots, $wikiId );
Assert::parameterType( 'object', $row, '$row' );
+ $timestamp = wfTimestamp( TS_MW, $row->ar_timestamp );
+ Assert::parameter( is_string( $timestamp ), '$row->rev_timestamp', 'must be a valid timestamp' );
+
$this->mArchiveId = intval( $row->ar_id );
// NOTE: ar_page_id may be different from $this->mTitle->getArticleID() in some cases,
$this->mArchiveId = intval( $row->ar_id );
// NOTE: ar_page_id may be different from $this->mTitle->getArticleID() in some cases,
@@
-81,11
+84,11
@@
class RevisionArchiveRecord extends RevisionRecord {
$this->mId = isset( $row->ar_rev_id ) ? intval( $row->ar_rev_id ) : null;
$this->mComment = $comment;
$this->mUser = $user;
$this->mId = isset( $row->ar_rev_id ) ? intval( $row->ar_rev_id ) : null;
$this->mComment = $comment;
$this->mUser = $user;
- $this->mTimestamp =
wfTimestamp( TS_MW, $row->ar_timestamp )
;
+ $this->mTimestamp =
$timestamp
;
$this->mMinorEdit = boolval( $row->ar_minor_edit );
$this->mDeleted = intval( $row->ar_deleted );
$this->mMinorEdit = boolval( $row->ar_minor_edit );
$this->mDeleted = intval( $row->ar_deleted );
- $this->mSize = i
ntval( $row->ar_len )
;
- $this->mSha1 =
isset
( $row->ar_sha1 ) ? $row->ar_sha1 : null;
+ $this->mSize = i
sset( $row->ar_len ) ? intval( $row->ar_len ) : null
;
+ $this->mSha1 =
!empty
( $row->ar_sha1 ) ? $row->ar_sha1 : null;
}
/**
}
/**
@@
-94,7
+97,7
@@
class RevisionArchiveRecord extends RevisionRecord {
* @return int
*/
public function getArchiveId() {
* @return int
*/
public function getArchiveId() {
- return $this->mId;
+ return $this->m
Archive
Id;
}
/**
}
/**
@@
-107,6
+110,7
@@
class RevisionArchiveRecord extends RevisionRecord {
}
/**
}
/**
+ * @throws RevisionAccessException if the size was unknown and could not be calculated.
* @return int The nominal revision size, never null. May be computed on the fly.
*/
public function getSize() {
* @return int The nominal revision size, never null. May be computed on the fly.
*/
public function getSize() {
@@
-120,6
+124,7
@@
class RevisionArchiveRecord 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() {
* @return string The revision hash, never null. May be computed on the fly.
*/
public function getSha1() {