Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #32640


Ignore:
Timestamp:
06/14/2015 02:54:11 AM (11 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32640 – Description

    initial v1  
    88when using the https://wordpress.org/plugins/debug-plugin-activation-errors/
    99plugin
    10 
     10{{{
    1111Warning:  Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 1987
    12 
    13 
    14 
    1512Warning:  Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 2020
    16 
    17 
    18 
    1913Warning:  Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 2050
    20 
    21 
    22 
    2314Warning:  Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 2593
    24 
    25 
    26 
    2715Warning:  Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 1824
    28 
    29 
    30 
    3116Warning:  array_keys() expects parameter 1 to be array, null given in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 1829
    32 
    33 
    34 
    3517Warning:  implode() [function.implode]: Invalid arguments passed in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 1829
    36 
     18}}}
    3719based on this error report i was able to determine the cause and location of the plugin activation issue to be with the /wp-includes/wp-db.php file
    3820i was also able to resolve this bug by fixing the code in a couple of functions within that file
    … …  
    4123here are the changes i made to the code:
    4224
    43 function code is contained in: function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' )
     25function code is contained in: `function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' )`
    4426
    4527line 1814
    4628original code:
     29{{{
    4730                if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) ) {
    4831                        return false;
    4932                }
    50 
     33}}}
    5134line 1814
    5235updated code:
     36{{{
    5337                if ( !in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) || !is_array( $data )) {
    5438                        return false;
    5539                }
     40}}}
    5641
    57 
    58 function code is contained in: function delete( $table, $where, $where_format = null )
     42function code is contained in: `function delete( $table, $where, $where_format = null )`
    5943
    6044line 1907
    6145original code:
     46{{{
    6247                if ( ! is_array( $where ) ) {
    6348                        return false;
    6449                }
     50}}}
    6551line 1907
    6652updated code
     53{{{
    6754                if (!is_array( $where ) ) {
    6855                        return false;
    6956                }
     57}}}