PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Text » Text_Wiki » Bug #7091

Variable Substitution Bug

Details

Submitted2006-03-10 18:09 UTC
Fromrandlem at bgsu dot edu
Assignedtoggg
StatusClosed
PackageText_Wiki
PHP Version5.1.1
OSLinux
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}