Annotation of pkgsrc/databases/phpldapadmin/patches/patch-lib_functions.php, revision 1.3
1.3 ! taca 1: $NetBSD$
1.1 taca 2:
1.3 ! taca 3: Fix for PHP 5.5 and later:
! 4: https://bugzilla.redhat.com/show_bug.cgi?id=974928
1.1 taca 5:
1.3 ! taca 6: --- lib/functions.php.orig 2012-10-01 06:54:14.000000000 +0000
1.1 taca 7: +++ lib/functions.php
1.3 ! taca 8: @@ -2127,7 +2127,7 @@ function password_types() {
! 9: * crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear.
1.1 taca 10: * @return string The hashed password.
11: */
1.3 ! taca 12: -function password_hash($password_clear,$enc_type) {
! 13: +function pla_password_hash($password_clear,$enc_type) {
! 14: if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
! 15: debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
! 16:
! 17: @@ -2318,7 +2318,7 @@ function password_check($cryptedpassword
! 18:
! 19: # SHA crypted passwords
! 20: case 'sha':
! 21: - if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
! 22: + if (strcasecmp(pla_password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
! 23: return true;
! 24: else
! 25: return false;
! 26: @@ -2327,7 +2327,7 @@ function password_check($cryptedpassword
! 27:
! 28: # MD5 crypted passwords
! 29: case 'md5':
! 30: - if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
! 31: + if( strcasecmp(pla_password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
! 32: return true;
! 33: else
! 34: return false;
! 35: @@ -2565,12 +2565,14 @@ function dn_unescape($dn) {
! 36: $a = array();
! 37:
! 38: foreach ($dn as $key => $rdn)
! 39: - $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn);
! 40: + $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
! 41: + function ($matches) { return chr(hexdec($matches[1])); }, $rdn );
! 42:
! 43: return $a;
! 44:
! 45: } else {
! 46: - return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn);
! 47: + return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
! 48: + function ($matches) { return chr(hexdec($matches[1])); }, $dn);
! 49: }
! 50: }
1.1 taca 51:
CVSweb <webmaster@jp.NetBSD.org>