From c9cc6a299b7dbbabf3afd54bf816754298f7b282 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jes=C3=BAs=20Mart=C3=ADnez=20Novo?= Date: Tue, 1 Aug 2017 19:55:11 +0200 Subject: [PATCH] Fix overzealous addQuotes for rc_source field in rebuildrecentchanges.php Those quotes aren't needed since those constants are being used as an array value and the database methods already quotes them. It caused the field to be double-quoted and being inserted with quotes on the database. Bug: T172205 Change-Id: I050f8d477600ee44794b7525a119b3d4451e5a28 --- maintenance/rebuildrecentchanges.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 142a4e5f2f..5df432eb7a 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -156,9 +156,7 @@ class RebuildRecentchanges extends Maintenance { 'rc_this_oldid' => $row->rev_id, 'rc_last_oldid' => 0, // is this ok? 'rc_type' => $row->page_is_new ? RC_NEW : RC_EDIT, - 'rc_source' => $row->page_is_new - ? $dbw->addQuotes( RecentChange::SRC_NEW ) - : $dbw->addQuotes( RecentChange::SRC_EDIT ) + 'rc_source' => $row->page_is_new ? RecentChange::SRC_NEW : RecentChange::SRC_EDIT , 'rc_deleted' => $row->rev_deleted ], @@ -239,9 +237,7 @@ class RebuildRecentchanges extends Maintenance { 'rc_last_oldid' => $lastOldId, 'rc_new' => $new, 'rc_type' => $new ? RC_NEW : RC_EDIT, - 'rc_source' => $new === 1 - ? $dbw->addQuotes( RecentChange::SRC_NEW ) - : $dbw->addQuotes( RecentChange::SRC_EDIT ), + 'rc_source' => $new === 1 ? RecentChange::SRC_NEW : RecentChange::SRC_EDIT, 'rc_old_len' => $lastSize, 'rc_new_len' => $size, ], @@ -325,7 +321,7 @@ class RebuildRecentchanges extends Maintenance { 'rc_this_oldid' => 0, 'rc_last_oldid' => 0, 'rc_type' => RC_LOG, - 'rc_source' => $dbw->addQuotes( RecentChange::SRC_LOG ), + 'rc_source' => RecentChange::SRC_LOG, 'rc_cur_id' => $field->isNullable() ? $row->page_id : (int)$row->page_id, // NULL => 0, -- 2.20.1