ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pear-general
pear-general
[PEAR] IT Logic Error?
by Adam Morton other posts by this author
Oct 7 2002 6:02PM messages near this date
[PEAR] ITX Sample code & Tutorial | [PEAR] [ANNOUNCEMENT] Translation-1.2 (beta) Released.
I'm not sure if there is a way to fix this or if I'm using the class
incorrectly but...when replacing a variable in a block with a string that
contains a "variable-like" sub-string, IT attempts to replace this.  This
causes some wierd show/hide block logic and can allow arbitrary input from
a form to "break" your template.

Example:

[code]
$replacements["NAME"] = "Hi I am {BOB}.  I like to write my name like {BOB}";
$template = "<!-- BEGIN block1 --> {NAME}<!-- END block1 -->";

$tpl-> setVariable($replacements);
$tpl-> setTemplate($template, TRUE, TRUE);
$tpl-> show();
[/code]

---------------------------------
Adam Morton
Developer - Web Technology Group
Appalachian State University
http://phpwebsite.appstate.edu



-- 
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved