From 3487c922b3f34449fecdddebe1fd2ee3b8c42e65 Mon Sep 17 00:00:00 2001 From: wn_ Date: Fri, 12 Aug 2022 15:31:19 +0000 Subject: Replace use of 'array_merge' with the spread operator and 'array_push' in various places. This isn't supported for arrays with string keys until PHP 8.1. https://wiki.php.net/rfc/spread_operator_for_array --- classes/pref/filters.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'classes/pref/filters.php') diff --git a/classes/pref/filters.php b/classes/pref/filters.php index e7c7877a7..19ec8d39e 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -538,7 +538,7 @@ class Pref_Filters extends Handler_Protected { $sth = $this->pdo->prepare("DELETE FROM ttrss_filters2 WHERE id IN ($ids_qmarks) AND owner_uid = ?"); - $sth->execute(array_merge($ids, [$_SESSION['uid']])); + $sth->execute([...$ids, $_SESSION['uid']]); } private function _save_rules_and_actions(int $filter_id): void { @@ -781,11 +781,11 @@ class Pref_Filters extends Handler_Protected { $sth = $this->pdo->prepare("UPDATE ttrss_filters2_rules SET filter_id = ? WHERE filter_id IN ($ids_qmarks)"); - $sth->execute(array_merge([$base_id], $ids)); + $sth->execute([$base_id, ...$ids]); $sth = $this->pdo->prepare("UPDATE ttrss_filters2_actions SET filter_id = ? WHERE filter_id IN ($ids_qmarks)"); - $sth->execute(array_merge([$base_id], $ids)); + $sth->execute([$base_id, ...$ids]); $sth = $this->pdo->prepare("DELETE FROM ttrss_filters2 WHERE id IN ($ids_qmarks)"); $sth->execute($ids); -- cgit v1.2.3