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 » HTML » HTML_Template_IT » Bug #4699

Needs to mention backslash-output behaviour

Details

Submitted2005-06-29 06:44 UTC
Fromsr at baghus dot net
Assignedpajoye
StatusBogus
PackageHTML_Template_IT
PHP Version4.3.11
OSLinux
Roadmaps(Not assigned)

Comments

[2005-06-29 06:44 UTC] sr at baghus dot net

Description:
------------
The template system needs "\\\$" to print out "\$" instead of "\\$" as needed by phps echo.
Furthermore, this is only the case with $. Other backslashified characters will output just fine: "\." outputs as "\.", no need for double or tripple backslashes.

This bit me while making and editor for regular expressions... \$ in the ruleset was always transformed to $ and the perl code evaluating the regexps died.

This happens with HTML-Template-IT version 1.10.

Reproduce code:
---------------
$template->setVariable( 'test1', "\$" );
$template->setVariable( 'test2', "\\$" );
$template->setVariable( 'test3', "\\\$" );
$template->setVariable( 'test4', "\." );

Expected result:
----------------
test1 -> $
test2 -> \$
test3 -> \\$
test4 -> .

Actual result:
--------------
test1 -> $
test2 -> $
test3 -> \$
test4 -> \.