ZF-2531: Filter stripping all repeated spaces

Issue Type: New Feature Created: 2008-01-30T15:55:45.000+0000 Last Updated: 2010-11-22T11:47:45.000+0000 Status: Resolved Fix version(s): - 1.11.0 (02/Nov/10)

Reporter: Karol Babioch (johnpatcher) Assignee: Thomas Weidner (thomas) Tags: - Zend_Filter

Related issues: Attachments:


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:

<pre class="highlight">

require_once 'Zend/Filter/Interface.php';

class Zend_Filter_StripRepeatedSpaces implements Zend_Filter_Interface

    public function filter($value)

        return preg_replace('/ +/', ' ', $value);




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:…

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… 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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.