• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révisionc1e6d703b51ea489d6ce24efbc67767ca88f1723 (tree)
l'heure2013-01-19 09:08:43
Auteurmiko2u <miko@cafe...>
Commitermiko2u

Message de Log

for PHP5.4 (internal hex2bin)

Change Summary

Modification

--- a/lib/func.php
+++ b/lib/func.php
@@ -349,13 +349,17 @@ function decode($str)
349349 return hex2bin($str);
350350 }
351351
352+// hex2bin -- Converts the hex representation of data to binary
353+// (PHP 5.4.0)
352354 // Inversion of bin2hex()
353-function hex2bin($hex_string)
354-{
355- // preg_match : Avoid warning : pack(): Type H: illegal hex digit ...
356- // (string) : Always treat as string (not int etc). See BugTrack2/31
357- return preg_match('/^[0-9a-f]+$/i', $hex_string) ?
358- pack('H*', (string)$hex_string) : $hex_string;
355+if (! function_exists('hex2bin')) {
356+ function hex2bin($hex_string)
357+ {
358+ // preg_match : Avoid warning : pack(): Type H: illegal hex digit ...
359+ // (string) : Always treat as string (not int etc). See BugTrack2/31
360+ return preg_match('/^[0-9a-f]+$/i', $hex_string) ?
361+ pack('H*', (string)$hex_string) : $hex_string;
362+ }
359363 }
360364
361365 // Remove [[ ]] (brackets)