From: Aaron Schulz Date: Sat, 29 Oct 2016 16:16:39 +0000 (-0700) Subject: Add missing Database::timestamp() calls X-Git-Tag: 1.31.0-rc.0~5000 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=92b2319de6a19f36b8a06d0d8ee31a2b020c5091;p=lhc%2Fweb%2Fwiklou.git Add missing Database::timestamp() calls This was broken for Postgres installations Change-Id: I0c1d442e3cf1d9a4d5359e7a8f8fd02a31d1ac65 --- 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;