#20392 [Csd->Bgs]: HTML_Template_IT error with $ in values

From: Date: Tue, 11 Feb 2003 19:27:17 +0000
Subject: #20392 [Csd->Bgs]: HTML_Template_IT error with $ in values
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-13133@lists.php.net to get a copy of this message
ID: 20392 Updated by: mansion@php.net Reported By: olonoh@yahoo.com -Status: Closed +Status: Bogus Bug Type: PEAR related Operating System: Linux PHP Version: 4.2.2 Assigned To: pajoye New Comment: I am wondering if using str_replace instead of preg_replace would solve these two problems... Could you please test it ? Thanks. Previous Comments: ------------------------------------------------------------------------ [2002-11-15 18:54:49] pajoye@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php $1 to $99 are used by preg_replace in the replacements arguments (see: http://fr2.php.net/manual/en/function.preg-replace.php). $t = new HTML_Template_IT(); $t->setTemplate('{x}', TRUE, TRUE); $t->setVariable('x', 'I have $a in my pocket'); $t->show(); thanks for the post pa ------------------------------------------------------------------------ [2002-11-15 17:30:03] pajoye@php.net Please upgrade the IT package to 1.0.0. The new class name is HTML_Template_IT $t = new HTML_Template_IT(); ... I ll be back with your problem this weekend. pa ------------------------------------------------------------------------ [2002-11-14 21:20:17] nicos@php.net Ewps, sorry. Probably too late for me. well I will see that with the maintainer. There is probably a reason to use preg_replace() and not str_replace() even if I don't see it at 4:18am :-) Thanks you. ------------------------------------------------------------------------ [2002-11-14 21:12:40] olonoh@yahoo.com I never suggested ereg(). I'm suggesting str_replace(), which is much faster than preg_replace() so the patch would actually give it a speed boost. ------------------------------------------------------------------------ [2002-11-14 21:00:56] nicos@php.net I'm not sure the maintainer want to lose the rapidity of the request just because of that too. ereg() are not enough fast. preg_* is definitly the best way to do a Template class. Anyway... ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/20392 -- Edit this bug report at http://bugs.php.net/?id=20392&edit=1

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