From 352665d6dfd41e9c3ac65f8ed2c8e6c1e231c3fa Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Tue, 17 Sep 2019 13:39:15 +0000 Subject: [PATCH] General: Ensure the arguments passed to `implode()` are in the correct order. The `implode()` function accepts two. parameters, `$glue` and `$pieces`. For historical reasons, these parameters have been accepted in any order, though it was recommended that the documented order of `$glue, $pieces` be used. Starting in PHP 7.4, specifying the parameters in the reverse order will trigger a deprecation notice with the plan to remove this tolerance in PHP 8.0. This change fixes the occurrences of reversed arguments in Core with the exception of those contained in included external libraries. These will be handled separately. Props jrf, jorbin. See #47746. git-svn-id: https://develop.svn.wordpress.org/trunk@46155 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/ajax-actions.php | 2 +- src/wp-admin/includes/upgrade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index a9e16af633..759f011b09 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -162,7 +162,7 @@ function wp_ajax_ajax_tag_search() { ) ); - echo join( $results, "\n" ); + echo join( "\n", $results ); wp_die(); } diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 9ebe82ed47..30abdd46ce 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -1056,7 +1056,7 @@ function upgrade_130() { $limit = $option->dupes - 1; $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) ); if ( $dupe_ids ) { - $dupe_ids = join( $dupe_ids, ',' ); + $dupe_ids = join( ',', $dupe_ids ); $wpdb->query( "DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)" ); } }