Zend Framework

Filter stripping all repeated spaces

Details

  • Type: New Feature New Feature
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Needs Proposal
  • Affects Version/s: 1.0.3
  • Fix Version/s: 1.11.0
  • Component/s: Zend_Filter
  • Labels:
    None
  • Fix Version Priority:
    Nice to Have

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);

    }

}

Activity

Hide
Karol Babioch added a comment -

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.

Show
Karol Babioch added a comment - 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.
Hide
Wil Sinclair added a comment -

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Show
Wil Sinclair added a comment - This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Hide
Thomas Weidner added a comment -

Closing as needs-proposal.

Currently under recommendation.
See http://framework.zend.com/wiki/display/ZFPROP/Zend_Filter_StripSpaces+-+Thomas+Weidner for details

Show
Thomas Weidner added a comment - Closing as needs-proposal. Currently under recommendation. See http://framework.zend.com/wiki/display/ZFPROP/Zend_Filter_StripSpaces+-+Thomas+Weidner for details
Hide
Thomas Weidner added a comment -

Correct fix version as it has been deleted unintentionally by another user

Show
Thomas Weidner added a comment - Correct fix version as it has been deleted unintentionally by another user

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour Original Estimate - 1 hour
Remaining:
1h
Time Spent - 1 hour Remaining Estimate - 1 hour
Logged:
1h
Time Spent - 1 hour Remaining Estimate - 1 hour