For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > July 2007 > Re: [SMARTY] default modifiers vs. foreach & if









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] default modifiers vs. foreach & if
Danilo Buerger

2007-05-14, 8:08 am

Hey.

I am not able to reproduce this. Could you please submit a working
sample? And yes, this should go to the dev list if you think its a bug.

Bye.

Artemy Tregoubenko schrieb:
> Hello everyone.
>
> I just tried to use this nice feature of smarty:
> http://smarty.php.net/manual/en/var...t.modifiers.php
> I think that auto-escaping of all values when outputting them is a great
> idea, so i set $this->default_modifiers = array('escape:"html"');
>
> It worked nice until I tried to use foreach to iterate over array of
> arrays. I got lots of messages like this:
> Warning: htmlspecialchars() expects parameter 1 to be string, array
> given...
>
> The same warnings were displayed when using "{if $array}".
>
> I looked into compiled templates and found that smarty applies default
> modifiers to all parameters of foreach, including
> "from=$array_of_arrays", and this generates warning.
>
> Hiding warnings is a bad practice, so I'm looking for another solution
> for this problem. By now I hacked _compile_foreach_start and
> _compile_if_tag so that default_modifiers are toggled off in the
> beginning and restored at the end of methods. I understand this is only
> partial solution.
>
> Can anyone, having deeper knowledge of smarty compiler, suggest better
> way to fix this?
> Or should I write about my problem to dev list?
>

Aneoo42

2007-06-22, 5:57 pm

HaCkeD aDuLT SiTe :)
Direct access to member zone
http://uniqueadult.com/members/video.php?file=1
username: 218571
password: wanttocome
change the number in the link to get other videos! There are gigs of them!
Sghsdgh

2007-06-28, 9:36 am

Petit brunette squirts wildly
http://girls-with-toys.info/gallery.php?id=218571
Enceterjo

2007-07-16, 7:11 am

Heather Locklear and Lindsay Lohan In A Lesbian Catfight!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com