kink | 8 Feb 13:11
Picon

SF.net SVN: squirrelmail:[14277] trunk/squirrelmail/plugins/mail_fetch/ functions.php

Revision: 14277
          http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=14277&view=rev
Author:   kink
Date:     2012-02-08 12:11:18 +0000 (Wed, 08 Feb 2012)
Log Message:
-----------
hex2bin is introduced in PHP 5.4

Modified Paths:
--------------
    trunk/squirrelmail/plugins/mail_fetch/functions.php

Modified: trunk/squirrelmail/plugins/mail_fetch/functions.php
===================================================================
--- trunk/squirrelmail/plugins/mail_fetch/functions.php	2012-02-08 12:09:10 UTC (rev 14276)
+++ trunk/squirrelmail/plugins/mail_fetch/functions.php	2012-02-08 12:11:18 UTC (rev 14277)
@@ -312,18 +312,21 @@
 // end of hooked functions

 /**
- * hex2bin - document me
+ * hex2bin - convert a hexadecimal string into binary
+ * Exists since PHP 5.4.
  */
-function hex2bin( $data ) {
+if ( ! function_exists('hex2bin') ) {
+    function hex2bin( $data ) {

-    /* Original code by josh@... */
+        /* Original code by josh@... */

-    $len = strlen($data);
-    $newdata = '';
-    for( $i=0; $i < $len; $i += 2 ) {
-        $newdata .= pack( "C", hexdec( substr( $data, $i, 2) ) );
+        $len = strlen($data);
+        $newdata = '';
+        for( $i=0; $i < $len; $i += 2 ) {
+            $newdata .= pack( "C", hexdec( substr( $data, $i, 2) ) );
+        }
+        return $newdata;
     }
-    return $newdata;
 }

 function mf_keyED( $txt ) {

This was sent by the SourceForge.net collaborative development platform, the world's largest Open
Source development site.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
-----
squirrelmail-cvs mailing list
List address: squirrelmail-cvs@...
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-cvs
Repository: http://squirrelmail.org/svn


Gmane