From 92b2319de6a19f36b8a06d0d8ee31a2b020c5091 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 29 Oct 2016 09:16:39 -0700 Subject: [PATCH] Add missing Database::timestamp() calls This was broken for Postgres installations Change-Id: I0c1d442e3cf1d9a4d5359e7a8f8fd02a31d1ac65 --- includes/MergeHistory.php | 6 ++++-- includes/WatchedItemQueryService.php | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/MergeHistory.php b/includes/MergeHistory.php index f797fe355c..e57f88099a 100644 --- a/includes/MergeHistory.php +++ b/includes/MergeHistory.php @@ -90,7 +90,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 +119,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() diff --git a/includes/WatchedItemQueryService.php b/includes/WatchedItemQueryService.php index 84972247a6..b7cdc53ab0 100644 --- a/includes/WatchedItemQueryService.php +++ b/includes/WatchedItemQueryService.php @@ -442,11 +442,13 @@ class WatchedItemQueryService { if ( isset( $options['start'] ) ) { $after = $options['dir'] === self::DIR_OLDER ? '<=' : '>='; - $conds[] = 'rc_timestamp ' . $after . ' ' . $db->addQuotes( $options['start'] ); + $conds[] = 'rc_timestamp ' . $after . ' ' . + $db->addQuotes( $db->timestamp( $options['start'] ) ); } if ( isset( $options['end'] ) ) { $before = $options['dir'] === self::DIR_OLDER ? '>=' : '<='; - $conds[] = 'rc_timestamp ' . $before . ' ' . $db->addQuotes( $options['end'] ); + $conds[] = 'rc_timestamp ' . $before . ' ' . + $db->addQuotes( $db->timestamp( $options['end'] ) ); } return $conds; -- 2.20.1