Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#17372 closed defect (bug) (worksforme)

Catchable fatal error when updating user profile

Reported by: zzb Owned by: zzb
Milestone: Priority: normal
Severity: critical Version: 3.1.2
Component: Users Keywords: reporter-feedback
Focuses: Cc:
PR Number:



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...

Change History (2)

#1 @kawauso
9 years ago

  • Keywords needs-patch has-patch removed
  • Summary changed from CATCHABLE FATAL ERROR WHEN UPDATING USER PROFILE to Catchable fatal error when updating user profile

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

#2 @SergeyBiryukov
8 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Feel free to reopen with more details if there's still a problem.

Note: See TracTickets for help on using tickets.