Make WordPress Core


Ignore:
Timestamp:
09/17/2019 01:39:15 PM (5 years ago)
Author:
desrosj
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r46096 r46155  
    10571057            $dupe_ids = $wpdb->get_col( $wpdb->prepare( "SELECT option_id FROM $wpdb->options WHERE option_name = %s LIMIT %d", $option->option_name, $limit ) );
    10581058            if ( $dupe_ids ) {
    1059                 $dupe_ids = join( $dupe_ids, ',' );
     1059                $dupe_ids = join( ',', $dupe_ids );
    10601060                $wpdb->query( "DELETE FROM $wpdb->options WHERE option_id IN ($dupe_ids)" );
    10611061            }
Note: See TracChangeset for help on using the changeset viewer.