RevisionStore: Properly encode timestamp
authorBrad Jorsch <bjorsch@wikimedia.org>
Sun, 18 Mar 2018 01:41:45 +0000 (21:41 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Sun, 18 Mar 2018 01:41:45 +0000 (21:41 -0400)
Timestamps in database queries need to be passed through
IDatabase::timestamp().

Change-Id: I1c163d80b2111a78bb10de49fe06d61f02c21d07

includes/Storage/RevisionStore.php

index 98ad287..2e3103c 100644 (file)
@@ -1044,9 +1044,10 @@ class RevisionStore
         * @return RevisionRecord|null
         */
        public function getRevisionByTimestamp( $title, $timestamp ) {
+               $db = $this->getDBConnection( DB_REPLICA );
                return $this->newRevisionFromConds(
                        [
-                               'rev_timestamp' => $timestamp,
+                               'rev_timestamp' => $db->timestamp( $timestamp ),
                                'page_namespace' => $title->getNamespace(),
                                'page_title' => $title->getDBkey()
                        ],