View Source

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[{zone-template-instance:ZFDEV:Zend Proposal Zone Template}

{zone-data:component-name}
Zend_Filter_StripNewlines
{zone-data}

{zone-data:proposer-list}
[My E-mail Address|mailto:mhujer@gmail.com]
Zend Liaison [~ralph]
{zone-data}

{zone-data:revision}
24th January 2008: Initial proposal, code, tests
27th January 2008: Changed SVN path
{zone-data}

{zone-data:overview}
Zend_Filter_StripNewlines is a filter that strips out newline control characters (\n \r \n\r)
{zone-data}

{zone-data:references}
* [Issue ZF-2427|http://framework.zend.com/issues/browse/ZF-2427]
{zone-data}

{zone-data:requirements}
* This component *will* strip newline control characters from the string.
* This component *will not* remove any other character.
{zone-data}

{zone-data:dependencies}
* Zend_Filter_Interface
{zone-data}

{zone-data:operation}
...
{zone-data}

{zone-data:milestones}
* Milestone 1: \[DONE\] Finalize proposal
* Milestone 2: \[DONE\] Working prototype checked into the http://zfdev.googlecode.com/svn/trunk/ZendFilterStripNewlines/
* Milestone 3: \[DONE\] Unit tests exist, work, and are checked into SVN.
* Milestone 4: Community and Zend review
{zone-data}

{zone-data:class-list}
* Zend_Filter_StripNewlines
{zone-data}

{zone-data:use-cases}
||UC-01||

{code}
<?php
$text = "Hello World\n\r";
$stripped = Zend_Filter::get($text, 'StripNewlines');
echo $stripped; //contains "Hello World";

{code}
{zone-data}

{zone-data:skeletons}
{code}
<?php
require_once 'Zend/Filter/Interface.php';
/**
* Class
*
*/
class Zend_Filter_StripNewlines implements Zend_Filter_Interface
{

public function filter ($value)
{
return str_replace(array("\n", "\r"), '', $value);
}
}
{code}
{zone-data}

{zone-template-instance}]]></ac:plain-text-body></ac:macro>