WordPress.org

Ready to get started?Download WordPress

Forums

MP3-jPlayer
[resolved] Javascript syntax error when caption has double quotes (4 posts)

  1. Chris Jean
    Member
    Posted 1 year ago #

    When a caption has one or more double quotes in it, the MP3J_PLAYLISTS variable will contain syntax errors due to the unescaped quote. I found that the MP3j_Main::compare_swap function escaped the titles entry but not the artists entry, thus causing the issue. I have a patch here that shows how the same escaping can be used to fix the issue for captions.

    I should note that you can use the json_encode function to generate fully-valid Javascript data structures from a PHP data structure. This would be a much easier way to generate this output rather than hand building it and possibly creating unknown syntax error conditions based on user input. You would have to restructure your functions to simply return data structures to be fed into the json_encode function, but it would help avoid future issues such as this.

    http://wordpress.org/extend/plugins/mp3-jplayer/

  2. simon.ward
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks Chris, will be fixed for next time.

  3. Chris Jean
    Member
    Posted 1 year ago #

    Glad to hear Simon. Thanks for checking on it.

  4. simon.ward
    Member
    Plugin Author

    Posted 1 year ago #

    Should now be fixed (version 1.8.3)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.