WordPress.org

Ready to get started?Download WordPress

Forums

Catchable fatal error: Object of class __PHP_Incomplete_Class could not be (11 posts)

  1. ifeaturecom
    Member
    Posted 3 years ago #

    Hi Guys,
    I need some help, I got this error when I try to save the changes I made in my profile.

    Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in /home/"deleted"/public_html/foodcartnegosyo.com/wp-includes/functions.php on line 1463

    And the code in my function line 1463 is this.

    function add_magic_quotes( $array ) {
    	foreach ( (array) $array as $k => $v ) {
    		if ( is_array( $v ) ) {
    			$array[$k] = add_magic_quotes( $v );
    		} else {
    			$array[$k] = addslashes( $v );
    		}
    	}
    	return $array;
    }
  2. bansuriflute
    Member
    Posted 3 years ago #

    Did you manage to resolve this? If so, how? I have the same problem..

  3. danzigism
    Member
    Posted 3 years ago #

    I am also experiencing this same exact issue when trying to edit user profiles. I just want to disable the bar. disabled all plugins as well. no love :(

  4. ifeaturecom
    Member
    Posted 3 years ago #

    got no luck here either.. the odd thing is when i try to update the other users profile i don't experience this kind of error.

  5. sruefer
    Member
    Posted 3 years ago #

    I have the same problem, I deactivated my plugins etc, but no luck. I recently upgraded to WP 3.1.2, not sure if that is the problem? I do not remember having that problem before, but I usually do not edit user profiles.
    I noticed that problem first when implementing a frontend user profile page with the s2member plugin. But as this problem happens even when updating member profiles in the admin area I assume this is a WP glitch.
    Any suggestions?

  6. zzb
    Member
    Posted 3 years ago #

    I am also having this same issue discovered today. I have been trying to isolate to any plugin but so far no luck.

  7. zzb
    Member
    Posted 3 years ago #

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

  8. esmi
    Forum Moderator
    Posted 3 years ago #

    Do not edit WordPress core files unless you really, really, know what you are doing. Not only do you risk bring your whole site down, you may also be exposing it to security risks. If you think you have located a bug, post it on Trac.

  9. zzb
    Member
    Posted 3 years ago #

    Trac updated as requested...

  10. esmi
    Forum Moderator
    Posted 3 years ago #

    Thanks :-)

  11. sruefer
    Member
    Posted 3 years ago #

    For me the problem was fixed by checking my database tables (especially the user meta one) for entries that come from deleted plugins. After deleting those, everything worked ok again. That is the preferred option I would say, instead of modifying core files. I briefly described it here:
    http://rufer-design.tumblr.com/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags