OSDN Git Service

BugTrack/767: Warning: unpack(): Type H: outside of string in ... (with PHP 4.3.10)
authorhenoheno <henoheno>
Thu, 30 Dec 2004 07:30:55 +0000 (16:30 +0900)
committerhenoheno <henoheno>
Thu, 30 Dec 2004 07:30:55 +0000 (16:30 +0900)
lib/func.php

index 2915605..f55a644 100644 (file)
@@ -2,7 +2,7 @@
 /////////////////////////////////////////////////
 // PukiWiki - Yet another WikiWikiWeb clone.
 //
-// $Id: func.php,v 1.20 2004/12/25 00:14:52 henoheno Exp $
+// $Id: func.php,v 1.21 2004/12/30 07:30:55 henoheno Exp $
 //
 
 // Ê¸»úÎó¤¬InterWikiName¤«¤É¤¦¤«
@@ -242,7 +242,9 @@ function arg_check($str)
 // ¥Ú¡¼¥¸Ì¾¤Î¥¨¥ó¥³¡¼¥É
 function encode($key)
 {
-       return ($key == '') ? '' : strtoupper(join('', unpack('H*0', $key)));
+       return ($key == '') ? '' : strtoupper(bin2hex($key));
+       // Equal to strtoupper(join('', unpack('H*0', $key)));
+       // But PHP 4.3.10 says 'Warning: unpack(): Type H: outside of string in ...'
 }
 
 // ¥Ú¡¼¥¸Ì¾¤Î¥Ç¥³¡¼¥É