Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Compilation of {if}..{/if} tags

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
zeke
Smarty n00b


Joined: 19 Dec 2007
Posts: 3

PostPosted: Wed Dec 19, 2007 10:33 am    Post subject: Compilation of {if}..{/if} tags Reply with quote

Hello,

I got the following error on several severs:

Code:

Warning: Compilation failed: repeated subpattern is too long at offset 15183 in /home/httpd/vhosts/xxxxxx/httpdocs/classes/templater/Smarty_Compiler.class.php on line 1259


The generated pattern is more than 15000 charactes long...

Is there any way to reduce the size of this expression?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Dec 19, 2007 2:39 pm    Post subject: Reply with quote

What does the template look like that its compiling?
Back to top
View user's profile Send private message Visit poster's website
zeke
Smarty n00b


Joined: 19 Dec 2007
Posts: 3

PostPosted: Wed Dec 19, 2007 2:50 pm    Post subject: Reply with quote

It fails on first {if}

Code:

{* $Id: index.tpl 3933 2007-09-13 14:14:14Z zeke $ *}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
{include file="meta.tpl"}
{strip}
<title>
{if $page_title}
   {$page_title}
{else}
   {$lang.page_title_text}
   {foreach from=$breadcrumbs item=i name="bkt"}
      {if $smarty.foreach.bkt.index==1} - {/if}{if !$smarty.foreach.bkt.first}{$i.title|escape}{if !$smarty.foreach.bkt.last} :: {/if}{/if}
   {/foreach}
{/if}
</title>
{/strip}
<link href="favicon.ico" rel="shortcut icon" />
<link href="{$skin_dir}/styles.css" rel="stylesheet" type="text/css" />
{include file="scripts/form_scripts.tpl"}

<!--[if IE]>
<link href="{$skin_dir}/styles_ie.css" rel="stylesheet" type="text/css" />
<![endif]-->

{if $settings.Appearance.categories_menu_type == 'emenu'}
<link href="{$skin_dir}/vmenu.css" rel="stylesheet" type="text/css" />
{/if}

</head>

<body>
{if 'SKINS_PANEL'|defined}
{include file="demo_skin_selector.tpl"}
{/if}
   <a name="top"></a>
   {* http://blog.html.it/layoutgala/LayoutGala14.html *}
   <div class="header">{include file="top.tpl"}</div>
   {include file="main.tpl"}
   <div class="footer">{include file="bottom.tpl"}</div>
   {include file="common_templates/loading_box.tpl"}
</body>

</html>
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Dec 19, 2007 4:10 pm    Post subject: Reply with quote

looks fine. do any of your templates compile ok?
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Dec 19, 2007 8:11 pm    Post subject: Reply with quote

Try searching the forums. There have been changes to the pcre engine that is shipped with PHP which have affected the used regexes. You can change limits to ensure the processing and IIR, there is a patch for certain issues. If you find the thread, maybe link to it again for others and if not, let me know and I will try to search for it.
Back to top
View user's profile Send private message
zeke
Smarty n00b


Joined: 19 Dec 2007
Posts: 3

PostPosted: Wed Dec 19, 2007 9:00 pm    Post subject: Reply with quote

mohrt wrote:

looks fine. do any of your templates compile ok?


Any template with {if}{/if} fails.

boots wrote:
Try searching the forums. There have been changes to the pcre engine that is shipped with PHP which have affected the used regexes. You can change limits to ensure the processing and IIR, there is a patch for certain issues. If you find the thread, maybe link to it again for others and if not, let me know and I will try to search for it.


Tried to search, but with no luck. We're using Smarty in our product - "CS-Cart shopping cart software", so any help will be appreciated.

Thank you for your help.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Dec 19, 2007 9:10 pm    Post subject: Reply with quote

Maybe this is it:

http://www.phpinsider.com/smarty-forum/viewtopic.php?t=10467

http://bugs.php.net/bug.php?id=40630&edit=1
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Thu Dec 20, 2007 7:33 pm    Post subject: Reply with quote

Even moreso, this thread: http://www.phpinsider.com/smarty-forum/viewtopic.php?t=10804

It contains a patch provided by c960657 (a consistent contributor and tireless bug catcher) that has been waiting far too long for a proper review. In my view, it should probably be applied, at least to CVS*.

*there are a few outstanding patches and reported issues since the last release. I would like to try to collect them over the holidays and prepare patches for them but judging by my ability (and lack thereof) to be deeply involved over the last year, I suspect that my enthusiasm may exceed my ability to maintain such a commitment . In that vein I'll try here to muster up a bit of outward enthusiasm; if there are some motivated folks here in the community who would like to pick up the ball and do some of the review, testing and patch preparation work, please consider reviewing the assorted bugs and feature requests submitted here at the forums and to the dev mailing list over the last six months. If any of the material piques your interest -- and you have the aptitude for it -- then please consider preparing and sending patches to the dev mailing list. I should note though that if you do intend to submit a patch, please ensure that it is well tested and that you take the time to provide some background info along with it -- that's the time consuming part, after all Smile Actually, if someone has the time to simply review and itemize the outstanding items (perhaps with links?), that would be really appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP