WordPress.org

Ready to get started?Download WordPress

Forums

Ajax Event Calendar
[resolved] Ajax Event calendar don't like the apostrophes (15 posts)

  1. hurraken
    Member
    Posted 3 years ago #

    Hello Eran,

    I'd like to congratulate you for this wonderful plugin.

    I notice that ajax calendar returns \' as soon as you write an apostrophe in the fields.

    It returns \' and when i save again, it returns \\', it adds a \ every time i save

    Is it a known issue or have i something to do to resolve this problem ?

    Best regards

    http://wordpress.org/extend/plugins/ajax-event-calendar/

  2. Eran Miller
    Member
    Plugin Author

    Posted 3 years ago #

    Are you using the latest version 0.9.8.6 - earlier versions of the plugin did not handle apostrophes and quotes correctly, the latest version does (or at least it should). If you are using the latest version, please be specific as to which field(s) are not properly escaping the apostrophe.

    Thanks
    Eran

  3. hurraken
    Member
    Posted 3 years ago #

    Thank you for your quick response Eran.

    I'm using the version 0.9.8.6.

    All the fields seem not to escape the apostrophe.

    Best regards

  4. hurraken
    Member
    Posted 3 years ago #

    EDIT : my WP is in French : may it be the cause of this problem ?

  5. Eran Miller
    Member
    Plugin Author

    Posted 3 years ago #

    It shouldn't be...but I will look into this.

    Thanks,
    Eran

  6. Eran Miller
    Member
    Plugin Author

    Posted 3 years ago #

    I just tested this combination in my local version of the plugin and I see no backslashes. I can create and update events with Editer l'évènement in the text and I have no problems.

    What is your url?

    Eran

  7. hurraken
    Member
    Posted 3 years ago #

    I've just send an email to you via your website.

    Regards.

  8. Eran Miller
    Member
    Plugin Author

    Posted 3 years ago #

    I was only able to replicate your problem by activating magic quotes gpc on my local server. Therefore, I believe the problem is that your php server has magic quotes gpc set.

    To stop this from happening, edit your php.ini file (or ask your host to) and disable that setting. Here's why the developers of PHP say it should no longer be used.

    Eran

  9. hurraken
    Member
    Posted 3 years ago #

    Hi Eran,

    Your diagnostic was the good : it's a problem of magic quotes.

    Here a fix : paste the following code in functions.php of your theme :

    <?php
    if ( get_magic_quotes_gpc() ) {
        $_POST      = array_map( 'stripslashes_deep', $_POST );
        $_GET       = array_map( 'stripslashes_deep', $_GET );
        $_COOKIE    = array_map( 'stripslashes_deep', $_COOKIE );
        $_REQUEST   = array_map( 'stripslashes_deep', $_REQUEST );
    }
    ?>
  10. hurraken
    Member
    Posted 3 years ago #

    Thank you for your help, i've really appreciated !

    Best regards

  11. Eran Miller
    Member
    Plugin Author

    Posted 3 years ago #

    Glad I could help!
    Thanks for posting your fix.

    It's important to note that while disabling magic quotes is the only way to avoid the apostrophe problem and a best coding practice, it can adversely affect php code (such as older plugins) that rely on that functionality.

    Eran

  12. saturnleia
    Member
    Posted 3 years ago #

    Hi Eran,

    First of all, I LOVE the calendar - it's beautiful.

    However, I'm having the \\ issue as well. I'm running version 0.9.9.2 and tried adding the code above to functions.php, but the \\ are still there. I also tried editing .htaccess and php.ini to remove magic quotes per your link to php.net, but neither of those edits fixed the issue (though I did check, and the server is running PHP 5.2.14). Any other thoughts?

  13. Eran Miller
    Member
    Plugin Author

    Posted 3 years ago #

    I'll look into it, but offhand I don't have any other suggestions.

    Thanks for your feedback.
    Eran

  14. ruizwashere
    Member
    Posted 2 years ago #

    While the solution that hurraken posted does indeed work, it creates other issues with urls. If your website is in the format http://www.example.com, then typing example.com will just give you a blank screen. I'm unsure of any other issues it can cause.

    Eran's suggestion of turning off Magic Quotes is the best solution and it can be as simple as editing the php.ini in your root directory (or the directory the WordPress is installed, depends). If there is no php.ini, then just make one. Add the line:

    magic_quotes_gpc = Off

    And it should work. It depends on your host really. If you have Bluehost, then just place it in your public_html folder, problem solved.

  15. createdbrazen12
    Member
    Posted 2 years ago #

    I'm having a similar issue, but it's only switching out the apostrophe in the event title (everywhere else seems fine). I tried editing the php.ini file & adding the above php to the functions.php file ...so far nothing has worked. Strange things.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic