Page 1 of 1

Wrong comment parsing

Posted: Sun Jul 08, 2007 9:07 pm
by Karotte
Hi,

I noticed that s9y is parsing my comments with serendipity_event_smartymarkup (so { } are parsed as smarty tag), even if it is told not to in the config options( plugin version 1.4). I'm using s9y 1.3alpha1 at the moment (the problem existed in the 1.2 betas too, as I upgraded after noticing the problem.)

A little look in the sourcecode I found this code in the plugin (and other plugins, too):

Code: Select all

                foreach ($this->markup_elements as $temp) {
                    if (serendipity_db_bool($this->get_config($temp['name'], true)) && isset($eventData[$temp['element']]) && !$eventData['properties']['ep_disable_markup_' . $this->instance] && !isset($serendipity['POST']['properties']['disable_markup_' . $this->instance])) {
The problem (I think) is this:

Code: Select all

isset($eventData[$temp['element']]) 
So the plugin is looking if there is a specific array item in the eventData.

$temp['element'] is "body" for the article body and "comment" for comments. Which would be fine, except that comments also have a "body" array item, and so the comments are matched twice, once with

Code: Select all

$temp['element'] == "body"
and second with

Code: Select all

$temp['element'] == "comment"
.


I don't understand when this behavior has changed. The line in inc/functions_comments.inc.php

Code: Select all

$comment['body']    = $comment['comment'];
is there since revision 7. :(

Re: Wrong comment parsing

Posted: Sun Jul 08, 2007 9:31 pm
by garvinhicking
Hi!

'Body' should NOT be set for comments. Foreign event plugins could maybe set this. Please state your event plugins.

Code: Select all

$comment['body']    = $comment['comment'];
This could block comes AFTER the plugin hook! It is not the reason. :-)

Best regards,
Garvin

Re: Wrong comment parsing

Posted: Sun Jul 08, 2007 10:00 pm
by garvinhicking
Hi!

Fixed in Smarty Markup Plugin 1.5.

Regards,
Garvin