WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Stray Random Quotes] Backslashes (15 posts)

  1. Usborne
    Member
    Posted 4 years ago #

    Hey, great plugin but I'm having a problem with it.

    Wherever I have an apostrophe in my quote, it automatically adds a backslash.

    For example if one of my quotes includes "It's my goal" - the manager prints "It\'s my goal".

    What can I do to prevent this from happening.

    Thanks

    http://wordpress.org/extend/plugins/stray-quotes/

  2. tictok
    Member
    Posted 4 years ago #

    Hi, I've just noticed the same thing on a live site of mine.

    I've been using Stray Random Quotes for a while and somehow managed to only include quotes without any apostrophes.... up until now.
    Recently added a bunch of new quotes and this is happening all over.

    Anyone have any ideas for fix?

    Many thanks
    Stef

  3. tictok
    Member
    Posted 4 years ago #

    Hiya - a quick fix,which I think will validate, is to use & # 39; (without any spaces) instead of using a apostrophe.

  4. not2bug
    Member
    Posted 4 years ago #

    I edited "stray-quotes/inc/stray_manage.php"

    //magic quotes
    //if ( ini_get('magic_quotes_gpc') ) {

    $quote = stripslashes($quote);
    $author = stripslashes($author);
    $source = stripslashes($source);
    $category = stripslashes($category);
    $visible = stripslashes($visible);
    //}

    My magic quotes were off, yet backslashes were creeping in somewhere.
    So I commented out the conditional of the if block to strip them off regardless.

    It works as expected for me now.

    Note: this is a workaround, not a bugfix.

  5. not2bug
    Member
    Posted 4 years ago #

    Oops. Apply the commenting workaround to this file as well.
    "stray-quotes/inc/stray_new.php"

    My previous post fixed editing. This fixes adding.

  6. zeyalabs
    Member
    Posted 4 years ago #

    And on this blog post you can find the complete packaged solution to this problem (causes of which are described in another article).

    The package also includes a really handy extra -- simple search functionality (allows you to search on quote body by a single keyword or phrase).

  7. trusktr
    Member
    Posted 4 years ago #

    Yeah, this bug needs to be fixed!!!

  8. trusktr
    Member
    Posted 4 years ago #

    Not2Bug's workaround works!

    Also, to get rid of slashes appearing in the widget title, add the following right before line 122 of stray-quotes/inc/stray_widgets.php:

    $posted['title'] = stripslashes($posted['title']);

  9. Ryan
    Member
    Posted 4 years ago #

    Great fix not2bug.

    Just a quick note in case it gives anyone else a 1/2-second pause when they implement this and it doesn't work -- you'll have to to resave your quotes.

  10. helloari
    Member
    Posted 3 years ago #

    thanks for that fix. but i might go back to 'quotes collection' unless some generous developer wants to maintain this great plugin.

  11. trusktr
    Member
    Posted 3 years ago #

    It appears the plugin has been fixed [resolved]

  12. cbiagi
    Member
    Posted 3 years ago #

    Just posting to confirm that not2bug's workaround worked for me. THANKS!

  13. trusktr
    Member
    Posted 3 years ago #

    If you have the latest version this bug should already be fixed...

  14. cbiagi
    Member
    Posted 3 years ago #

    I'm using the current version (1.9.9) and still had this problem.

  15. aravere
    Member
    Posted 3 years ago #

    Thanks, Zeyalabs, for the fix. Works great! No slashes, and like the new features. So far, so good!

Topic Closed

This topic has been closed to new replies.

About this Topic