largersmallernormaltext version of this page

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0008919 [phplist] RSS minor always 12-01-07 22:01 21-01-08 18:50
Reporter skoenig View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version 2.11.2
Summary 0008919: $ symbols within feeds are interpreted as variables at send time
Description Note: It's been happening since my first build 2.10.2 but wasn't an important thing until now.

Set up an RSS list.
Point the feed to something that has dollars in frequently like engadget
http://feeds.engadget.com/weblogsinc/engadget [^]

Set up an HTML newsletter (haven't checked Text yet).

What should be $9.99 comes out as .99

Looking at the feeds the RSS HTML data is properly encapsulated in [content] CDATAs but I think this error also happens when it's raw TEXT as in a [description] field.

Might be a quick fix but i can't navigate the feed parser so easily.

I checked all the incoming feeds against feedvalidator and they all pass.
Additional Information
Tags No tags attached.
Attached Files

- Relationships
related to 0002705closed PHPList v2.11 release 
related to 0003721closed phplist 2.10.x 

-  Notes
(0022691)
skoenig (reporter)
18-01-07 19:06

Fixed.

In rsslib.php in function parseRSSTemplate escape $ symbols already in the content before processing starts during the for each loop.

Thus the functions looks like below:

function parseRSSTemplate($template,$data) {
  foreach ($data as $key => $val) {
    if (!preg_match("#^\d+$#",$key)) {

      // SK MOD: escape $ symbols in $vals for content $keys
      $val = str_replace('$','\$',$val);

# print "$key => $val
";
      $template = preg_replace('#\['.preg_quote($key).'\]#i',$val,$template);
     }
   }
  $template = eregi_replace("\[[A-Z\. ]+\]","",$template);

  return $template;
}

Improvements and optimizations very very welcome.
(0030978)
bas (developer)
23-08-07 17:40

Suggested fix has been tested and it works indeed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker