}
/**
+ * Given a string, will strip out any characters that are not allowed in
+ * the IMAP 'atom' definition (RFC 3501 [9]).
+ *
+ * @param string $str An ASCII string.
+ *
+ * @return string The string with the disallowed atom characters stripped
+ * out.
+ */
+ public function stripNonAtomChars($str)
+ {
+ return str_replace(array('(', ')', '{', ' ', '%', '*', '"', '\\', ']'), '', preg_replace('/[\x00-\x1f\x7f]/', '', $str));
+ }
+
+ /**
* Return the "base subject" defined in RFC 5256 [2.1].
*
* @param string $str The original subject string.
<api>alpha</api>
</stability>
<license uri="http://www.gnu.org/copyleft/lesser.html">LGPL</license>
- <notes>* Add sequence sort (numeric sort by UID/sequence number).
+ <notes>* Add Horde_Imap_Client_Utils::stripNonAtomChars().
+ * Add sequence sort (numeric sort by UID/sequence number).
* Add ability to disable server capabilities.
* Add Horde_Imap_Client_Base::parseCacheId().
* Added STATUS_LASTMODSEQ and STATUS_LASTMODSEQUIDS status() entries.