logo       

Re: Bug in CVS HEAD: msg#00019

Subject: Re: Bug in CVS HEAD
Now you broke "<?php echo time(); ?>{$smarty.now}" in your 3rd commit (1.390). Patch:

Index: Smarty_Compiler.class.php
===================================================================
RCS file: /repository/smarty/libs/Smarty_Compiler.class.php,v
retrieving revision 1.390
diff -r1.390 Smarty_Compiler.class.php
364a365
> $text_blocks[$i] = str_replace('<?',$tmp_id,$text_blocks[$i]);

Danilo Buerger schrieb:
I dont think so, my patch is against 1.389 which seems to be the latest revision of Smarty_Compiler.class.php ... (i am subscribed to the cvs mailing list as well so i saw your 2nd commit ;-)

Your 2nd commit just fixes the problem when *no* compiled tags are present, but in my example a compiler tag is present and it still breaks. Thats what my patch is trying to fix.

Monte Ohrt schrieb:
There is a patch in CVS for this, moments after you got the last update I presume :)

Danilo Buerger wrote:
Hey list,

Smarty goes berserk when trying to embed php code:
Having php_handling == SMARTY_PHP_PASSTHRU :

--- template ---
{$smarty.now}<?php echo time(); ?>

--- compile ---
<?php echo time(); ?>
<?php echo '<?' ?>
php echo '<?php echo '<?' ?>
php'; ?>
 echo time(); <?php echo '<?' ?>
php echo '?>'; ?>

--- expected compile ---
<?php echo time(); ?>
<?php echo '<?php'; ?>
 echo time(); <?php echo '?>'; ?>

And when having php_handling == SMARTY_PHP_ALLOW :

--- compile ---
<?php echo time(); ?>
<?php echo '<?' ?>
php echo time(); ?>

--- expected compile ---
<?php echo time(); ?>
<?php echo time(); ?>

Here is the fix:

Index: Smarty_Compiler.class.php
===================================================================
RCS file: /repository/smarty/libs/Smarty_Compiler.class.php,v
retrieving revision 1.389
diff -r1.389 Smarty_Compiler.class.php
357c357
<
---
>
372c372
<         $compiled_content .= $text_blocks[$i];
---
> $compiled_content .= str_replace('<?',$tmp_id,$text_blocks[$i]);




--
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
audio.irate.dev...    yellowdog.gener...    ietf.ips/2002-0...    xfree86.fonts/2...    busybox/2003-07...    emacs.jdee/2004...    linux.mandrake....    hardware.microc...    user-groups.lin...    science.analysi...    version-control...    db.filemaker.de...    cluster.openmos...    mail.eyebrowse....    text.xml.xerces...    kde.devel.kwrit...    finance.moneyda...    gcc.regression/...    network.routing...    os.freebsd.deve...    recreation.radi...    qnx.openqnx.dev...    python.xml/2002...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe