<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
  <title>aC forum: clean() Functionality Enhancement</title>
  <link>http://www.activecollab.com/forums/topic/1620/</link>
  <description>Recent posts on topic: clean() Functionality Enhancement</description>
  <dc:language>en-us</dc:language>
  <pubDate>Sat, 06 Sep 2008 13:15:32 CDT</pubDate>
  
  <item>
    <link>http://www.activecollab.com/forums/post/7734/#post7734</link>
    <guid>http://www.activecollab.com/forums/post/7734/#post7734</guid>
    <title>Post #2 by levi</title>
    <dc:creator>levi</dc:creator>
    <description><![CDATA[<p>I did the same thing firespade.  I think this functionality is desired by most (if not all) users.</p>]]></description>
    <pubDate>Tue, 15 May 2007 09:12:05 CDT</pubDate>
  </item>
  <item>
    <link>http://www.activecollab.com/forums/post/7724/#post7724</link>
    <guid>http://www.activecollab.com/forums/post/7724/#post7724</guid>
    <title>Post #1 by firespade</title>
    <dc:creator>firespade</dc:creator>
    <description><![CDATA[<p>Got tired of CRLF being associated in each use of the clean() method throughout activeCollab.<br />
<br />
So I tracked down the method in '/environment/functions/general.php' on (or around) line 72.<br />
<br />
This method looks like:<br />
&lt;?php<br />
function clean($str) {<br />
    $str = preg_replace('/&amp;(?!#[0-9]+;)/s', '&amp;amp;', $str);<br />
    $str = str_replace(array('&lt;', '&gt;', '&quot;'), array('&amp;lt;', '&amp;gt;', '&amp;quot;'), $str);<br />
    return $str;<br />
} // clean<br />
?&gt;<br />
<br />
Below the str_replace() iteration you can add a nl2br() method to convert the CRLF to line break tags (eg. &lt;br&gt;). My new clean() method looks like..<br />
<br />
&lt;?php<br />
function clean($str) {<br />
    $str = preg_replace('/&amp;(?!#[0-9]+;)/s', '&amp;amp;', $str);<br />
  	$str = str_replace(array('&lt;', '&gt;', '&quot;'), array('&amp;lt;', '&amp;gt;', '&amp;quot;'), $str);<br />
  	$str = nl2br($str);<br />
  	return $str;<br />
  } // clean<br />
?&gt;<br />
<br />
The result? Instead of never having line breaks (which seems to drive my team mad), every time ENTER is pressed you will get your expected result.<br />
<br />
Regards,<br />
Anthony aka firespade</p>]]></description>
    <pubDate>Mon, 14 May 2007 13:33:16 CDT</pubDate>
  </item>
</channel>
</rss>