Opened 12 years ago
Closed 12 years ago
#17372 closed defect (bug) (worksforme)
Catchable fatal error when updating user profile
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | critical | Version: | 3.1.2 |
Component: | Users | Keywords: | reporter-feedback |
Focuses: | Cc: |
Description
ERROR MESSAGE WHEN UPDATING USER PROFILE version 3.1.2
Catchable fatal error: Object of class PHP_Incomplete_Class could not be converted to string in /home/artworks/public_html/wp-includes/functions.php on line 1486
Found a solution...
wp-includes/functions.php lines 1458 to 1469
Replace this:
function add_magic_quotes( $array ) {
global $wpdb;
foreach ( (array) $array as $k => $v ) {
if ( is_array( $v ) ) {
$array[$k] = add_magic_quotes( $v );
} else {
$array[$k] = $wpdb->escape( $v );
}
}
return $array;
}
With this:
function add_magic_quotes( $array ) {
global $wpdb;
if ( is_array($array) ) {
foreach ( $array as $k => $v ) {
$array[$k] = add_magic_quotes( $v );
}
} elseif ( is_string($array) ) {
$array = $wpdb->escape( $array );
}
return $array;
}
Don't know why this was not done in the latest version 3.1.2 If it was it was not updated on my auto upgrade. The patch takes care of the problem on my install...
Can you reproduce this on SVN trunk without any plugins active? Not sure what would be trying to pass a class to be magic quoted