From 198585d8a0b559e4cae397e17a38bd0a295f9942 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Fri, 9 Aug 2019 22:04:51 +0800 Subject: [PATCH] Fix implode() wrong parameter order (#6866) It has been deprecated in PHP 7.4. Such as PHP deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /var/www/roundcubemail/program/lib/Roundcube/rcube_db.php on line 917 Signed-off-by: Jack Cherng --- bin/installto.sh | 2 +- plugins/enigma/lib/enigma_ui.php | 2 +- program/lib/Roundcube/rcube_contacts.php | 2 +- program/lib/Roundcube/rcube_db.php | 2 +- program/steps/addressbook/search.inc | 4 ++-- program/steps/mail/sendmail.inc | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/installto.sh b/bin/installto.sh index 291bebf71..1d029115a 100755 --- a/bin/installto.sh +++ b/bin/installto.sh @@ -130,7 +130,7 @@ if (strtolower($input) == 'y') { } if (!empty($adds)) { - echo implode($adds, "\n") . "\n\n"; + echo implode("\n", $adds) . "\n\n"; } echo "Running update script at target...\n"; diff --git a/plugins/enigma/lib/enigma_ui.php b/plugins/enigma/lib/enigma_ui.php index 00156c69c..781ad1034 100644 --- a/plugins/enigma/lib/enigma_ui.php +++ b/plugins/enigma/lib/enigma_ui.php @@ -752,7 +752,7 @@ class enigma_ui } $table->add('title', html::label('key-name', rcube::Q($this->enigma->gettext('newkeyident')))); - $table->add(null, html::tag('ul', 'proplist', implode($identities, "\n"))); + $table->add(null, html::tag('ul', 'proplist', implode("\n", $identities))); // Key size $select = new html_select(array('name' => 'size', 'id' => 'key-size')); diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php index 6e0de82d9..237a47648 100644 --- a/program/lib/Roundcube/rcube_contacts.php +++ b/program/lib/Roundcube/rcube_contacts.php @@ -357,7 +357,7 @@ class rcube_contacts extends rcube_addressbook if (!empty($post_search) || !empty($required)) { $ids = array(0); // build key name regexp - $regexp = '/^(' . implode(array_keys($post_search), '|') . ')(?:.*)$/'; + $regexp = '/^(' . implode('|', array_keys($post_search)) . ')(?:.*)$/'; // use initial WHERE clause, to limit records number if possible if (!empty($where)) $this->set_search_set($where); diff --git a/program/lib/Roundcube/rcube_db.php b/program/lib/Roundcube/rcube_db.php index 12e3be6a7..e17cfdf02 100644 --- a/program/lib/Roundcube/rcube_db.php +++ b/program/lib/Roundcube/rcube_db.php @@ -914,7 +914,7 @@ class rcube_db $name[] = $start . $elem . $end; } - return implode($name, '.'); + return implode('.', $name); } /** diff --git a/program/steps/addressbook/search.inc b/program/steps/addressbook/search.inc index a8147d6bf..1564a3eeb 100644 --- a/program/steps/addressbook/search.inc +++ b/program/steps/addressbook/search.inc @@ -207,8 +207,8 @@ function rcmail_contact_search() // search request ID $search_request = md5('addr' - .(is_array($fields) ? implode($fields, ',') : $fields) - .(is_array($search) ? implode($search, ',') : $search)); + .(is_array($fields) ? implode(',', $fields) : $fields) + .(is_array($search) ? implode(',', $search) : $search)); // save search settings in session $_SESSION['search'][$search_request] = $search_set; diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 94b450253..cfcaab6ea 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -82,7 +82,7 @@ if ($isHtml) { } // append doctype and html/body wrappers - $bstyle = !empty($bstyle) ? (" style='" . implode($bstyle, '; ') . "'") : ''; + $bstyle = !empty($bstyle) ? (" style='" . implode('; ', $bstyle) . "'") : ''; $message_body = '' . ''