ZF-2531: Filter stripping all repeated spaces
Description
A filter stripping all repeated spaces would be useful. Html for example ignores all repeated spaces an just the first is shown.
Such a filter could look like that:
<?php
require_once 'Zend/Filter/Interface.php';
class Zend_Filter_StripRepeatedSpaces implements Zend_Filter_Interface
{
public function filter($value)
{
return preg_replace('/ +/', ' ', $value);
}
}
Comments
Posted by Karol Babioch (johnpatcher) on 2008-01-30T16:39:38.000+0000
I think a filter called "Zend_Filter_StripSpaces" will be much more senseful. In the constructor you can set whether all spaces or just the repeated ones will be removed.
I will make a proposal in the next days.
Posted by Karol Babioch (johnpatcher) on 2008-01-30T17:50:26.000+0000
I just commited the proposal: http://framework.zend.com/wiki/display/…
Posted by Wil Sinclair (wil) on 2008-04-18T13:11:49.000+0000
This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Posted by Thomas Weidner (thomas) on 2010-08-01T02:07:58.000+0000
Closing as needs-proposal.
Currently under recommendation. See http://framework.zend.com/wiki/display/… for details
Posted by Thomas Weidner (thomas) on 2010-11-22T11:47:45.000+0000
Correct fix version as it has been deleted unintentionally by another user