Merge "Add support for PHP7 random_bytes in favor of mcrypt_create_iv"
[lhc/web/wiklou.git] / includes / MergeHistory.php
index f797fe3..8cf3af1 100644 (file)
@@ -24,6 +24,7 @@
  *
  * @file
  */
+use Wikimedia\Timestamp\TimestampException;
 
 /**
  * Handles the backend logic of merging the histories of two
@@ -90,7 +91,8 @@ class MergeHistory {
                                        'revision',
                                        'MAX(rev_timestamp)',
                                        [
-                                               'rev_timestamp <= ' . $this->dbw->timestamp( $mwTimestamp ),
+                                               'rev_timestamp <= ' .
+                                                       $this->dbw->addQuotes( $this->dbw->timestamp( $mwTimestamp ) ),
                                                'rev_page' => $this->source->getArticleID()
                                        ],
                                        __METHOD__
@@ -118,7 +120,8 @@ class MergeHistory {
                                $this->timestampLimit = $lasttimestamp;
                        }
 
-                       $this->timeWhere = "rev_timestamp <= {$this->dbw->timestamp( $timeInsert )}";
+                       $this->timeWhere = "rev_timestamp <= " .
+                               $this->dbw->addQuotes( $this->dbw->timestamp( $timeInsert ) );
                } catch ( TimestampException $ex ) {
                        // The timestamp we got is screwed up and merge cannot continue
                        // This should be detected by $this->isValidMerge()