Wrong comment parsing

Found a bug? Tell us!!
Post Reply
Karotte
Regular
Posts: 8
Joined: Tue Jun 14, 2005 11:48 pm

Wrong comment parsing

Post 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. :(
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Wrong comment parsing

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Wrong comment parsing

Post by garvinhicking »

Hi!

Fixed in Smarty Markup Plugin 1.5.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply