Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Latest CVS: {strip} doesn't fully strip

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Tue Aug 26, 2003 2:40 pm    Post subject: Latest CVS: {strip} doesn't fully strip Reply with quote

Code:
  {capture name="test"}{strip}
    {if $foo == "bar"}
      blah
    {else}
      blub
    {/if}
  {/strip}{/capture}
 
  "{$smarty.capture.test}"


The above example will output " blub ". Notice the space at the beginning and at the end of the string. It seems this happens since you moved back {strip} into the compiler.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Aug 26, 2003 4:32 pm    Post subject: Reply with quote

i cannot reproduce this. neither with cvs nor with 2.6.0-RC1.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
boots
Administrator


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

PostPosted: Tue Aug 26, 2003 5:02 pm    Post subject: Reply with quote

hmm. Using andre's example, I reproduce the exact same output that he does with the current cvs. I didn't test 2.6.0RC1, but interestingly, 2.5.0 shows the exact same behaviour.
Back to top
View user's profile Send private message
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Wed Aug 27, 2003 5:51 am    Post subject: Reply with quote

?!? Hmm... I'll test again Confused
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Wed Aug 27, 2003 5:53 am    Post subject: Reply with quote

I may have said that in a confusing way--I reproduced andre's claim Smile
Back to top
View user's profile Send private message
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Wed Aug 27, 2003 6:18 am    Post subject: Reply with quote

Bingo: Using Lastest CVS...

After the first {strip} you should add a space so the line looks
'{capture name="test"}{strip} '

This space won't be stripped.

Then add a space behind "blub" or "{/if}" and it won't be filtered too.

My test code looks like the following:

Code:
$template = new Smarty();
$template->display("test.tpl");



BTW: messju, what are you doing at 5:30 a.m.?!?! Don't you need a bit of sleep Razz
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Aug 27, 2003 8:58 am    Post subject: Reply with quote

okay, this is fixed in cvs now. please test if i didn't break anything else around {strip}.

@André: 5:30 ? normally i sleep at this time-of-day. maybe you got fooled by the timezones phpBB displays??
Back to top
View user's profile Send private message Send e-mail Visit poster's website
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Wed Aug 27, 2003 9:15 am    Post subject: Reply with quote

Looks good now... thanks Very Happy
I'll report if I find something unusual.

@messju: Oops timezones, yes... +1 hour Wink But 6:30 is early enough ... Shocked
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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