WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] htmlspecialchars_decode() Error, Press This broken after 2.7.1 upgrade (12 posts)

  1. RexFromArs
    Member
    Posted 5 years ago #

    OK, here's the deal: after manually upgrading to 2.7.1 (the automatic update plug-in didn't work again, so I used FTP instead), any time I go to use the "Press This" bookmarklet *and* have text copied on the target page, I get the following error:

    Warning: htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /home/myname/public_html/personal/wp-includes/compat.php on line 105

    It works fine if I don't highlight any text, but that defeats the purpose behind Press This, no?

    Press This worked fine prior to the 2.7.1 upgrade.

    This blog is hosted by JaguarPC. The server is running some flavour of Linux with Apache (1.3.41), PHP (5.2.5) and MySQL (4.1.22).

  2. jwise
    Member
    Posted 5 years ago #

    This certainly seems to be a bug. The $string on line 105 should be $str. This fixes everything.

  3. RexFromArs
    Member
    Posted 5 years ago #

    OK... what am I doing wrong here?

    I changed line 105 from gettype( $string ) to gettype( $str ) and am still getting the error....

  4. alanft
    Member
    Posted 5 years ago #

    change it on the line before too.

  5. MichaelH
    Member
    Posted 5 years ago #

    Connecting the dots: http://core.trac.wordpress.org/ticket/9090

    wp-includes/compat.php
    change line 102 from:
    function htmlspecialchars_decode( $str, $quote_style = ENT_COMPAT )
    to
    function htmlspecialchars_decode( $string, $quote_style = ENT_COMPAT )

    change line 114 from:
    return wp_specialchars_decode( $str, $quote_style );
    to
    return wp_specialchars_decode( $string, $quote_style );

  6. RexFromArs
    Member
    Posted 5 years ago #

    Awesome! The above fix works perfectly!

    Thank you as always for the prompt help! This place rocks! :)

  7. cipote
    Member
    Posted 5 years ago #

    Yay! The press this is finally working for me now. Thanks for this suggestion MichaelH!

  8. julakim
    Member
    Posted 5 years ago #

    I am surprised how quick the solutions can ALWAYS be found.
    Thank you community.

  9. hvaninah
    Member
    Posted 5 years ago #

    Thank you MichaelH !

  10. bigsquaredot
    Member
    Posted 5 years ago #

    Thanks a ton for the heads up on this, guys. I was having some trouble with the WP-Email plugin due to the compat.php error, and these line changes fixed it.

  11. pds911
    Member
    Posted 5 years ago #

    Like bigsquaredot, I'm having trouble with the WP-Email plugin.

    I'm not a techie, and I think I've tried all of the above combinations.

    Am I supposed to edit all of the following lines:
    102, 104, 105, 114?

    Or just 102 and 114?

  12. webmatter
    Member
    Posted 5 years ago #

    Thanks so much! Saved me a lot of headache ...

Topic Closed

This topic has been closed to new replies.

About this Topic