Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.3

Bug #7091 Variable Substitution Bug
Submitted: 2006-03-10 18:09 UTC
From: randlem at bgsu dot edu Assigned: toggg
Status: Closed Package: Text_Wiki (version 1.1.0)
PHP Version: 5.1.1 OS: Linux
Roadmaps: (Not assigned)    

 [2006-03-10 18:09 UTC] randlem at bgsu dot edu (Mark Randles)
Description: ------------ In the LaTeX render classes for both wikilink and freelink (and most likely others) variable substitution is used to insert the values into the formatted string. This is unsafe as it inserts an extra \ which masks a { and latex cannot match the next } correctly. A more correct (or at least safer) version should use concatination to build the return string. Affects (at least): Render/Latex/Wikilink.php Render/Latex/Freelink.php Test script: --------------- $text = 'foobar'; $href = ''; return "$text\\footnote\{$href}"; A safer version: return $text. '\\footnote{'. $href. '}'; Expected result: ---------------- foobar\footnote{} Actual result: -------------- foobar\footnote\{}


 [2006-03-10 18:33 UTC] toggg
I would not say "unsafe" but wrong. However, this is not (or should not be) related to the variable replacement. I guess the intention was: return "$text\\footnote\{{$href}}"; However, return $text. '\\footnote{'. $href. '}'; should be simpler and quicker. :) Some review to do, I guess.
 [2006-03-11 11:14 UTC] toggg
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.