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
This commit is contained in:
Jonathan Desrosiers 2019-09-17 13:39:15 +00:00
parent 5928234d05
commit 352665d6df
2 changed files with 2 additions and 2 deletions

View File

@ -162,7 +162,7 @@ function wp_ajax_ajax_tag_search() {
)
);
echo join( $results, "\n" );
echo join( "\n", $results );
wp_die();
}

View File

@ -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)" );
}
}