Skip to content

Commit

Permalink
[mms] Horde_Mime::is8bit() no longer requires the charset parameter.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Oct 10, 2014
1 parent 33df700 commit c9d8be1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions framework/Mime/doc/Horde/Mime/UPGRADING
Expand Up @@ -34,6 +34,10 @@ Upgrading to 2.5
This method is deprecated. Use Horde_Mime_Headers#generateMessageId()
instead.

- is8bit()

The 2nd parameter ($charset) is no longer needed/used.

- isChild()

This method is deprecated. Use Horde_Mime_Id#isChild() instead.
Expand Down
13 changes: 10 additions & 3 deletions framework/Mime/lib/Horde/Mime.php
Expand Up @@ -42,13 +42,20 @@ class Horde_Mime
*
* @param string $string The string to check.
* @param string $charset The charset of the string. Defaults to
* US-ASCII.
* US-ASCII. (@deprecated)
*
* @return boolean True if string contains non US-ASCII characters.
* @return boolean True if string contains non 7-bit characters.
*/
public static function is8bit($string, $charset = null)
{
return ($string != Horde_String::convertCharset($string, $charset, 'US-ASCII'));
$string = strval($string);
for ($i = 0, $len = strlen($string); $i < $len; ++$i) {
if (ord($string[$i]) > 127) {
return true;
}
}

return false;
}

/**
Expand Down
2 changes: 2 additions & 0 deletions framework/Mime/package.xml
Expand Up @@ -28,6 +28,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Horde_Mime::is8bit() no longer requires the charset parameter.
* [mms] Improved MIME encoding.
* [mms] Deprecated Horde_Mime::quotedPrintableEncode() and move to Horde_Mime_QuotedPrintable.
* [mms] Moved MIME ID manipulation/query methods out of Horde_Mime and into Horde_Mime_Id.
Expand Down Expand Up @@ -1459,6 +1460,7 @@
<date>2014-09-30</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
* [mms] Horde_Mime::is8bit() no longer requires the charset parameter.
* [mms] Improved MIME encoding.
* [mms] Deprecated Horde_Mime::quotedPrintableEncode() and move to Horde_Mime_QuotedPrintable.
* [mms] Moved MIME ID manipulation/query methods out of Horde_Mime and into Horde_Mime_Id.
Expand Down

0 comments on commit c9d8be1

Please sign in to comment.