Viewing 5 replies - 1 through 5 (of 5 total)
  • This would mean editting a core WP file.

    wp-includes/functions.php

    http://core.trac.wordpress.org/attachment/ticket/9640/9640.patch

    Red coloured lines indicate the existing code.
    Green lines indicate the new code (to go in place of).

    Line numbers are to the left so it’s hard to go wrong.

    Find the RED parts in the file, overwrite those with the GREEN parts, using the line numbers as a reference.

    Thread Starter John Stringfellow

    (@frenchtowner)

    T,

    Thanks for the help. Their numbers do not match mine. Is that a different version they are using? and can I apply to this to a live site?

    I did find the right lines, but I just want to be sure that this is OK before I do it.

    John

    Yes you’re right the lines for said code are.

    Lines: 1246 – 1257

    This area.

    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;
    }

    Update that with..

    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;
    }

    I think that’s right….

    Backup first if in doubt…

    Thread Starter John Stringfellow

    (@frenchtowner)

    T,

    I finally had the guts to slog through and it did solve the problem. I can now change information on my profile and work with other user accounts. Now I have to figure out what is causing me to get question marks in my post editor box in every place where I have two spaces!

    I am very grateful for the help and for your patience with me!

    John

    I just had a client contact me today with this issue, they are using 2.8.5 but I’m updating this to 2.8.6 in a moment. If this is an old bug, why is he seeing this now? I don’t feel comfortable updating the .php file because my line numbers are not even remotely close to what I see shown above.

    Any idea why this would show up now with an upgrade?

    ** UPDATE **

    I did upgrade to 2.8.6 and still had the issue, but found the text to be changed and the patch worked great.
    Thank you so much for posting that!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Apply patch for bug (9640.patch) or wait for new stable release?’ is closed to new replies.