aboutsummaryrefslogblamecommitdiff
path: root/pkgs/webapps/phpldapadmin/ldap-php5_5.patch
blob: 8545ad27d39703a6f36c78cc238db8d81475bce7 (plain) (tree)























































































                                                                                                                    
diff -Nrbu phpldapadmin-1.2.3/lib/PageRender.php phpldapadmin-1.2.3-OK/lib/PageRender.php
--- phpldapadmin-1.2.3/lib/PageRender.php	2012-10-01 10:54:14.000000000 +0400
+++ phpldapadmin-1.2.3-OK/lib/PageRender.php	2013-11-12 03:44:40.518144839 +0400
@@ -287,7 +287,7 @@
 						break;
 
 					default:
-						$vals[$i] = password_hash($passwordvalue,$enc);
+						$vals[$i] = pla_password_hash($passwordvalue,$enc);
 				}
 
 				$vals = array_unique($vals);
diff -Nrbu phpldapadmin-1.2.3/lib/ds_ldap.php phpldapadmin-1.2.3-OK/lib/ds_ldap.php
--- phpldapadmin-1.2.3/lib/ds_ldap.php	2012-10-01 10:54:14.000000000 +0400
+++ phpldapadmin-1.2.3-OK/lib/ds_ldap.php	2013-11-12 03:40:56.638343739 +0400
@@ -1117,12 +1117,14 @@
 		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 -Nrbu phpldapadmin-1.2.3/lib/functions.php phpldapadmin-1.2.3-OK/lib/functions.php
--- phpldapadmin-1.2.3/lib/functions.php	2012-10-01 10:54:14.000000000 +0400
+++ phpldapadmin-1.2.3-OK/lib/functions.php	2013-11-12 03:44:17.298065264 +0400
@@ -2127,7 +2127,7 @@
  *        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 @@
 
 		# 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 @@
 
 		# 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;
@@ -2392,7 +2392,7 @@
 
 		# SHA512 crypted passwords
 		case 'sha512':
-			if (strcasecmp(password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0)
+			if (strcasecmp(pla_password_hash($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0)
 				return true;
 			else
 				return false;
@@ -2565,12 +2565,14 @@
 		$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);
 	}
 }