#20199 [NEW]: HTML_Template_IT Logic Error

From: Date: Thu, 31 Oct 2002 19:46:33 +0000
Subject: #20199 [NEW]: HTML_Template_IT Logic Error
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10397@lists.php.net to get a copy of this message
From: adam@tux.appstate.edu Operating system: Red Hat 8.0 PHP version: 4.2.3 PHP Bug Type: PEAR related Bug description: HTML_Template_IT Logic Error When assigning a string that contains a "replacement variable"-like sub-string to an actual replacement variable, on IT's next "pass" it will replace the variable-like sub-string with nothing and if this string was contained within a block it will remove the block: Example Lets assume for some unknown reason the programmer wishes to print name like this -> {name} <code> <?php require_once("HTML/IT.php"); $vars["title"] = "Welcome! {Adam}"; $vars["content"] = "This is some content!"; $template = " <!-- BEGIN TITLE --> {title}<br /> <!-- END TITLE --> <!-- BEGIN CONTENT --> {content}<br /> <!-- END CONTENT -->"; $tpl = new HTML_Template_IT; $tpl->setTemplate($template, TRUE, TRUE); $tpl->setVariable($vars); echo $tpl->get(); ?> </code> When the above template and data is processed by IT it will not print the name contained in the string $vars["title"]. I hope this is enough info to figure out what's up :) Adam -- Edit bug report at http://bugs.php.net/?id=20199&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=20199&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=20199&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=20199&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=20199&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=20199&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=20199&r=support Expected behavior: http://bugs.php.net/fix.php?id=20199&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=20199&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=20199&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=20199&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20199&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=20199&r=dst IIS Stability: http://bugs.php.net/fix.php?id=20199&r=isapi

« previous php.pear.dev (#10397) next »