• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

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

PukiWiki


コミットメタ情報

リビジョンc954cdf4b7987b663180558b380dd792e9852799 (tree)
日時2014-06-02 05:50:11
作者umorigu <umorigu@gmai...>
コミッターumorigu

ログメッセージ

Rename 'hex2bin' to 'pkwk_hex2bin' because of PHP 5.4+ compatibility

PHP 5.4 has embedded 'hex2bin', so the pukiwiki-original 'hex2bin'
needs to be given another name.

変更サマリ

差分

--- a/lib/auth.php
+++ b/lib/auth.php
@@ -75,7 +75,7 @@ function pkwk_hash_compute($phrase = '', $scheme = '{x-php-md5}', $prefix = TRUE
7575 // LDAP MD5
7676 case '{md5}' :
7777 $hash = ($prefix ? ($canonical ? '{MD5}' : $scheme) : '') .
78- base64_encode(hex2bin(md5($phrase)));
78+ base64_encode(pkwk_hex2bin(md5($phrase)));
7979 break;
8080
8181 // LDAP SMD5
@@ -83,13 +83,13 @@ function pkwk_hash_compute($phrase = '', $scheme = '{x-php-md5}', $prefix = TRUE
8383 // MD5 Key length = 128bits = 16bytes
8484 $salt = ($salt != '' ? substr(base64_decode($salt), 16) : substr(crypt(''), -8));
8585 $hash = ($prefix ? ($canonical ? '{SMD5}' : $scheme) : '') .
86- base64_encode(hex2bin(md5($phrase . $salt)) . $salt);
86+ base64_encode(pkwk_hex2bin(md5($phrase . $salt)) . $salt);
8787 break;
8888
8989 // LDAP SHA
9090 case '{sha}' :
9191 $hash = ($prefix ? ($canonical ? '{SHA}' : $scheme) : '') .
92- base64_encode(hex2bin(sha1($phrase)));
92+ base64_encode(pkwk_hex2bin(sha1($phrase)));
9393 break;
9494
9595 // LDAP SSHA
@@ -97,7 +97,7 @@ function pkwk_hash_compute($phrase = '', $scheme = '{x-php-md5}', $prefix = TRUE
9797 // SHA-1 Key length = 160bits = 20bytes
9898 $salt = ($salt != '' ? substr(base64_decode($salt), 20) : substr(crypt(''), -8));
9999 $hash = ($prefix ? ($canonical ? '{SSHA}' : $scheme) : '') .
100- base64_encode(hex2bin(sha1($phrase . $salt)) . $salt);
100+ base64_encode(pkwk_hex2bin(sha1($phrase . $salt)) . $salt);
101101 break;
102102
103103 // LDAP CLEARTEXT and just cleartext
--- a/lib/func.php
+++ b/lib/func.php
@@ -304,11 +304,11 @@ function encode($key)
304304 // Decode page name
305305 function decode($key)
306306 {
307- return hex2bin($key);
307+ return pkwk_hex2bin($key);
308308 }
309309
310310 // Inversion of bin2hex()
311-function hex2bin($hex_string)
311+function pkwk_hex2bin($hex_string)
312312 {
313313 // preg_match : Avoid warning : pack(): Type H: illegal hex digit ...
314314 // (string) : Always treat as string (not int etc). See BugTrack2/31