Changes between Initial Version and Version 1 of Ticket #32640
- Timestamp:
- 06/14/2015 02:54:11 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32640 – Description
initial v1 8 8 when using the https://wordpress.org/plugins/debug-plugin-activation-errors/ 9 9 plugin 10 10 {{{ 11 11 Warning: Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 1987 12 13 14 15 12 Warning: Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 2020 16 17 18 19 13 Warning: Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 2050 20 21 22 23 14 Warning: Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 2593 24 25 26 27 15 Warning: Invalid argument supplied for foreach() in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 1824 28 29 30 31 16 Warning: 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 35 17 Warning: implode() [function.implode]: Invalid arguments passed in /home/tispgu/public_html/wp-testdomain/wp-includes/wp-db.php on line 1829 36 18 }}} 37 19 based 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 38 20 i was also able to resolve this bug by fixing the code in a couple of functions within that file … … 41 23 here are the changes i made to the code: 42 24 43 function code is contained in: function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' )25 function code is contained in: `function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' )` 44 26 45 27 line 1814 46 28 original code: 29 {{{ 47 30 if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) ) { 48 31 return false; 49 32 } 50 33 }}} 51 34 line 1814 52 35 updated code: 36 {{{ 53 37 if ( !in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ) ) || !is_array( $data )) { 54 38 return false; 55 39 } 40 }}} 56 41 57 58 function code is contained in: function delete( $table, $where, $where_format = null ) 42 function code is contained in: `function delete( $table, $where, $where_format = null )` 59 43 60 44 line 1907 61 45 original code: 46 {{{ 62 47 if ( ! is_array( $where ) ) { 63 48 return false; 64 49 } 50 }}} 65 51 line 1907 66 52 updated code 53 {{{ 67 54 if (!is_array( $where ) ) { 68 55 return false; 69 56 } 57 }}}