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

Warning output filter trimwhitespace

 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
rincewind
Smarty Rookie


Joined: 13 Nov 2007
Posts: 5

PostPosted: Thu Oct 22, 2009 10:44 am    Post subject: Warning output filter trimwhitespace Reply with quote

With smarty3 I get the following php warning if using trimwhitespace as an output filter:
Code:

Warning: Parameter 2 to smarty_outputfilter_trimwhitespace() expected to be a reference, value given in /var/www/localhost/htdocs/phpmyprofiler/include/Smarty3/sysplugins/internal.run_filter.php on line 59

Usage:
Code:

$smarty = new Smarty;
$smarty->load_filter('output', 'trimwhitespace');
$smarty->display('test.tpl');
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Oct 22, 2009 1:08 pm    Post subject: Reply with quote

This is fixed in the SVN now.
Back to top
View user's profile Send private message
rincewind
Smarty Rookie


Joined: 13 Nov 2007
Posts: 5

PostPosted: Thu Oct 22, 2009 2:43 pm    Post subject: Reply with quote

Great, THX!
Back to top
View user's profile Send private message
Wmm
Smarty n00b


Joined: 05 Dec 2009
Posts: 3

PostPosted: Sat Dec 05, 2009 9:19 pm    Post subject: Reply with quote

I still have this problem in beta 5. I haven't tried any SVN version but I would expect the fix would also be in beta 5 Smile.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Dec 06, 2009 12:55 pm    Post subject: Reply with quote

I just rechecked. This fix is in all beta releases.

But if you have other filters make sure that the $smarty parameter has not the & (by reference operator).

smarty_outputfilter_trimwhitespace($source, $smarty)
Back to top
View user's profile Send private message
Wmm
Smarty n00b


Joined: 05 Dec 2009
Posts: 3

PostPosted: Sat Dec 12, 2009 11:37 pm    Post subject: Reply with quote

Hmm, I got it working right now, but I'm not sure if I was wrong or Smarty is wrong.

I got it working now using $smarty->load_filter('output', 'trimwhitespace');

But with $smarty->register_outputfilter("outputfilter.trimwhitespace.php"); I get that error. It's probably my mistake I guess Smile.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Dec 13, 2009 2:54 pm    Post subject: Reply with quote

It was wrong usage. register_outputfiler is used to resister a PHP function which is defined locally in the calling script as filter.
Back to top
View user's profile Send private message
Wmm
Smarty n00b


Joined: 05 Dec 2009
Posts: 3

PostPosted: Mon Dec 14, 2009 1:20 pm    Post subject: Reply with quote

Ah, as I thought. My bad Smile.

Thanks for the great support though Smile.
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 -> Smarty 3 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