summaryrefslogtreecommitdiff
path: root/databases/phpldapadmin/patches
diff options
context:
space:
mode:
authortaca <taca>2015-11-29 11:25:53 +0000
committertaca <taca>2015-11-29 11:25:53 +0000
commit672983bcfa94f38955bd9e6d8ad09af76fc35df2 (patch)
treea2dc2760a9dbe6c8a25c677d6bf8d23e8bcc59ae /databases/phpldapadmin/patches
parenta939a5d93d9ce4fe7bdc8ac8978b8521fccfde73 (diff)
downloadpkgsrc-672983bcfa94f38955bd9e6d8ad09af76fc35df2.tar.gz
Allow work on PHP 5.5/5.6. Patch is based on patch
on https://bugzilla.redhat.com/show_bug.cgi?id=974928.
Diffstat (limited to 'databases/phpldapadmin/patches')
-rw-r--r--databases/phpldapadmin/patches/patch-lib_ds__ldap.php24
-rw-r--r--databases/phpldapadmin/patches/patch-lib_functions.php51
2 files changed, 75 insertions, 0 deletions
diff --git a/databases/phpldapadmin/patches/patch-lib_ds__ldap.php b/databases/phpldapadmin/patches/patch-lib_ds__ldap.php
new file mode 100644
index 00000000000..1b2b8632e95
--- /dev/null
+++ b/databases/phpldapadmin/patches/patch-lib_ds__ldap.php
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_ds__ldap.php,v 1.1 2015/11/29 11:25:53 taca Exp $
+
+Fix for PHP 5.5 and later:
+ https://bugzilla.redhat.com/show_bug.cgi?id=974928
+
+--- lib/ds_ldap.php.orig 2012-10-01 06:54:14.000000000 +0000
++++ lib/ds_ldap.php
+@@ -1117,12 +1117,14 @@ class ldap extends DS {
+ if (is_array($dn)) {
+ $a = array();
+ foreach ($dn as $key => $rdn)
+- $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn);
++ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
++ function ($matches) { return chr(hexdec($matches[1])); }, $rdn);
+
+ return $a;
+
+ } else
+- return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn);
++ return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
++ function ($matches) { return chr(hexdec($matches[1])); }, $dn);
+ }
+
+ public function getRootDSE($method=null) {
diff --git a/databases/phpldapadmin/patches/patch-lib_functions.php b/databases/phpldapadmin/patches/patch-lib_functions.php
new file mode 100644
index 00000000000..afd762baea2
--- /dev/null
+++ b/databases/phpldapadmin/patches/patch-lib_functions.php
@@ -0,0 +1,51 @@
+$NetBSD: patch-lib_functions.php,v 1.3 2015/11/29 11:25:53 taca Exp $
+
+Fix for PHP 5.5 and later:
+ https://bugzilla.redhat.com/show_bug.cgi?id=974928
+
+--- lib/functions.php.orig 2012-10-01 06:54:14.000000000 +0000
++++ lib/functions.php
+@@ -2127,7 +2127,7 @@ function password_types() {
+ * crypt, ext_des, md5crypt, blowfish, md5, sha, smd5, ssha, sha512, or clear.
+ * @return string The hashed password.
+ */
+-function password_hash($password_clear,$enc_type) {
++function pla_password_hash($password_clear,$enc_type) {
+ if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
+ debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
+
+@@ -2318,7 +2318,7 @@ function password_check($cryptedpassword
+
+ # SHA crypted passwords
+ case 'sha':
+- if (strcasecmp(password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
++ if (strcasecmp(pla_password_hash($plainpassword,'sha'),'{SHA}'.$cryptedpassword) == 0)
+ return true;
+ else
+ return false;
+@@ -2327,7 +2327,7 @@ function password_check($cryptedpassword
+
+ # MD5 crypted passwords
+ case 'md5':
+- if( strcasecmp(password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
++ if( strcasecmp(pla_password_hash($plainpassword,'md5'),'{MD5}'.$cryptedpassword) == 0)
+ return true;
+ else
+ return false;
+@@ -2565,12 +2565,14 @@ function dn_unescape($dn) {
+ $a = array();
+
+ foreach ($dn as $key => $rdn)
+- $a[$key] = preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$rdn);
++ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
++ function ($matches) { return chr(hexdec($matches[1])); }, $rdn );
+
+ return $a;
+
+ } else {
+- return preg_replace('/\\\([0-9A-Fa-f]{2})/e',"''.chr(hexdec('\\1')).''",$dn);
++ return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/',
++ function ($matches) { return chr(hexdec($matches[1])); }, $dn);
+ }
+ }
+