View previous topic :: View next topic |
Author |
Message |
rincewind Smarty Rookie
Joined: 13 Nov 2007 Posts: 5
|
Posted: Thu Oct 22, 2009 10:44 am Post subject: Warning output filter trimwhitespace |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Oct 22, 2009 1:08 pm Post subject: |
|
|
This is fixed in the SVN now. |
|
Back to top |
|
rincewind Smarty Rookie
Joined: 13 Nov 2007 Posts: 5
|
Posted: Thu Oct 22, 2009 2:43 pm Post subject: |
|
|
Great, THX! |
|
Back to top |
|
Wmm Smarty n00b
Joined: 05 Dec 2009 Posts: 3
|
Posted: Sat Dec 05, 2009 9:19 pm Post subject: |
|
|
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 . |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Dec 06, 2009 12:55 pm Post subject: |
|
|
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 |
|
Wmm Smarty n00b
Joined: 05 Dec 2009 Posts: 3
|
Posted: Sat Dec 12, 2009 11:37 pm Post subject: |
|
|
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 . |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Dec 13, 2009 2:54 pm Post subject: |
|
|
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 |
|
Wmm Smarty n00b
Joined: 05 Dec 2009 Posts: 3
|
Posted: Mon Dec 14, 2009 1:20 pm Post subject: |
|
|
Ah, as I thought. My bad .
Thanks for the great support though . |
|
Back to top |
|
|