Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • jaystarkey Friend
    #175044

    I am using JAComment and it appears when titles contain certain characters, for example : or #, the plugin breaks and doesn’t correctly process the entry.

    The code that I am using in the component in question is:
    [PHP]{jacomment contentid=$item->id option=com_mycom contenttitle=$item->title }”;[/PHP]

    JAComment works on the vast majority of entries, but it goes unprocessed on pages where the content contains punctuation.

    I see that in the jacomment.php content plugin file, there is a line:

    [PHP]var $_plgCode = “#{JAComment(.*?)}#i”;[/PHP]

    I assume this is where the regex comes from.

    Can anyone see why the plugin is failing when the title contains certain characters (by the way, I tried using preg_quote() on the output in my component, but that didn’t help at all.

    jaystarkey Friend
    #443908

    I figured it out. Your code (actually in plugins/system/jacomment.php) has only the “i” (case insensitive) mode. My component “title” can include line breaks, which was causing the regex to stop working. I just added “s” as an option, which seemed to fix things.

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 1 voice, and was last updated by  jaystarkey 12 years, 2 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum