Home » Text » Text_Wiki » Bug #7091
Variable Substitution Bug
Details
| Submitted | 2006-03-10 18:09 UTC |
|---|---|
| From | randlem at bgsu dot edu |
| Assigned | toggg |
| Status | Closed |
| Package | Text_Wiki |
| PHP Version | 5.1.1 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2006-03-10 18:09 UTC] randlem at bgsu dot edu
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 = 'http://www.example.com/wiki?id=foobar';
return "$text\\footnote\{$href}";
A safer version:
return $text. '\\footnote{'. $href. '}';
Expected result:
----------------
foobar\footnote{http://www.example.com/wiki?id=foobar}
Actual result:
--------------
foobar\footnote\{http://www.example.com/wiki?id=foobar}