OSDN Git Service

BugTrack2/235: bin2hex() wants string, not int
authorhenoheno <henoheno>
Sat, 12 May 2007 07:44:39 +0000 (16:44 +0900)
committerumorigu <umorigu@gmail.com>
Tue, 25 Nov 2014 17:05:52 +0000 (02:05 +0900)
lib/func.php

index c92573a..09483dc 100644 (file)
@@ -294,17 +294,18 @@ function arg_check($str)
 }
 
 // Encode page-name
-function encode($key)
+function encode($str)
 {
-       return ($key == '') ? '' : strtoupper(bin2hex($key));
+       $str = strval($str);
+       return ($str == '') ? '' : strtoupper(bin2hex($str));
        // Equal to strtoupper(join('', unpack('H*0', $key)));
        // But PHP 4.3.10 says 'Warning: unpack(): Type H: outside of string in ...'
 }
 
 // Decode page name
-function decode($key)
+function decode($str)
 {
-       return pkwk_hex2bin($key);
+       return pkwk_hex2bin($str);
 }
 
 // Inversion of bin2hex()