[wp-trac] [WordPress Trac] #17372: CATCHABLE FATAL ERROR WHEN UPDATING USER PROFILE

WordPress Trac wp-trac at lists.automattic.com
Tue May 10 21:53:19 UTC 2011


#17372: CATCHABLE FATAL ERROR  WHEN UPDATING USER PROFILE
-------------------------+-------------------------------------------------
 Reporter:  zzb          |      Owner:  zzb
     Type:  defect       |     Status:  new
  (bug)                  |  Milestone:  Awaiting Review
 Priority:  normal       |    Version:  3.1.2
Component:  Users        |   Keywords:  needs-patch has-patch reporter-
 Severity:  critical     |  feedback
-------------------------+-------------------------------------------------
 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...

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17372>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list