Search
SailfishOS Open Build Service
>
Projects
>
home:nielnielsen
>
squirrelmail
> patch0.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File patch0.patch of Package squirrelmail
--- plugins/mail_fetch/functions.php 2012-02-07 23:05:36 UTC (rev 14275) +++ plugins/mail_fetch/functions.php 2012-02-08 12:09:10 UTC (rev 14276) @@ -92,15 +92,20 @@ return ''; } -function hex2bin( $data ) { - /* Original code by josh@... */ +/** + * hex2bin() only exists since PHP 5.4 + */ +if ( ! function_exists('hex2bin') ) { + function hex2bin( $data ) { + /* 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 ) {