Date: Sun, 27 Apr 2014 09:51:18 +0000 (UTC) From: Matthew Seaman <matthew@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r352409 - in head/net/phpldapadmin: . files Message-ID: <201404270951.s3R9pIDh063243@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: matthew Date: Sun Apr 27 09:51:17 2014 New Revision: 352409 URL: http://svnweb.freebsd.org/changeset/ports/352409 QAT: https://qat.redports.org/buildarchive/r352409/ Log: Add patches from the PLA git repository http://sourceforge.net/u/nihilisticz/phpldapadmin/commit_browser These solve a function name clash with a new php-5.5 built-in and use of the deprecated preg_replace /e modifier. Submitted by: Zhang Huangbin Obtained from: http://sourceforge.net/u/nihilisticz/phpldapadmin/commit_browser Added: head/net/phpldapadmin/files/patch-lib__PageRender.php (contents, props changed) head/net/phpldapadmin/files/patch-lib__ds_ldap.php (contents, props changed) head/net/phpldapadmin/files/patch-lib__ds_ldap_pla.php (contents, props changed) head/net/phpldapadmin/files/patch-lib__functions.php (contents, props changed) Modified: head/net/phpldapadmin/Makefile head/net/phpldapadmin/files/patch-tools__po__Makefile Modified: head/net/phpldapadmin/Makefile ============================================================================== --- head/net/phpldapadmin/Makefile Sun Apr 27 09:35:27 2014 (r352408) +++ head/net/phpldapadmin/Makefile Sun Apr 27 09:51:17 2014 (r352409) @@ -3,7 +3,7 @@ PORTNAME= phpldapadmin PORTVERSION= 1.2.3 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= net www MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-php5/${PORTVERSION} @@ -18,10 +18,6 @@ NO_ARCH= yes NO_BUILD= yes USE_PHP= gettext ldap openssl pcre session xml iconv hash -# Function name clashes with new PHP built-in. Uses deprecated -# preg_replace /e modifier. -IGNORE_WITH_PHP=55 - WANT_PHP_WEB= yes GROUPS?= ${WWWGRP} Added: head/net/phpldapadmin/files/patch-lib__PageRender.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/phpldapadmin/files/patch-lib__PageRender.php Sun Apr 27 09:51:17 2014 (r352409) @@ -0,0 +1,29 @@ +--- ./lib/PageRender.php.orig 2012-10-01 07:54:14.000000000 +0100 ++++ ./lib/PageRender.php 2014-04-27 09:42:04.069744333 +0100 +@@ -287,7 +287,7 @@ + break; + + default: +- $vals[$i] = password_hash($passwordvalue,$enc); ++ $vals[$i] = password_hash_custom($passwordvalue,$enc); + } + + $vals = array_unique($vals); +@@ -957,7 +957,7 @@ + if (trim($val)) + $enc_type = get_enc_type($val); + else +- $enc_type = $server->getValue('appearance','password_hash'); ++ $enc_type = $server->getValue('appearance','password_hash_custom'); + + $obfuscate_password = obfuscate_password_display($enc_type); + +@@ -982,7 +982,7 @@ + if (trim($val)) + $enc_type = get_enc_type($val); + else +- $enc_type = $server->getValue('appearance','password_hash'); ++ $enc_type = $server->getValue('appearance','password_hash_custom'); + + echo '<table cellspacing="0" cellpadding="0"><tr><td valign="top">'; + Added: head/net/phpldapadmin/files/patch-lib__ds_ldap.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/phpldapadmin/files/patch-lib__ds_ldap.php Sun Apr 27 09:51:17 2014 (r352409) @@ -0,0 +1,30 @@ +--- ./lib/ds_ldap.php.orig 2012-10-01 07:54:14.000000000 +0100 ++++ ./lib/ds_ldap.php 2014-04-27 09:42:04.087756668 +0100 +@@ -1116,13 +1116,24 @@ + + 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); ++ foreach ($dn as $key => $rdn) { ++ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', ++ function ($m) { ++ return ''.chr(hexdec('\\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 ($m) { ++ return ''.chr(hexdec('\\1')).''; ++ }, ++ $dn ++ ); + } + + public function getRootDSE($method=null) { Added: head/net/phpldapadmin/files/patch-lib__ds_ldap_pla.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/phpldapadmin/files/patch-lib__ds_ldap_pla.php Sun Apr 27 09:51:17 2014 (r352409) @@ -0,0 +1,11 @@ +--- ./lib/ds_ldap_pla.php.orig 2012-10-01 07:54:14.000000000 +0100 ++++ ./lib/ds_ldap_pla.php 2014-04-27 09:42:04.099743918 +0100 +@@ -16,7 +16,7 @@ + function __construct($index) { + parent::__construct($index); + +- $this->default->appearance['password_hash'] = array( ++ $this->default->appearance['password_hash_custom'] = array( + 'desc'=>'Default HASH to use for passwords', + 'default'=>'md5'); + Added: head/net/phpldapadmin/files/patch-lib__functions.php ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/phpldapadmin/files/patch-lib__functions.php Sun Apr 27 09:51:17 2014 (r352409) @@ -0,0 +1,66 @@ +--- ./lib/functions.php.orig 2012-10-01 07:54:14.000000000 +0100 ++++ ./lib/functions.php 2014-04-27 09:42:04.122737345 +0100 +@@ -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 password_hash_custom($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(password_hash_custom($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(password_hash_custom($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(password_hash_custom($plainpassword,'sha512'),'{SHA512}'.$cryptedpassword) == 0) + return true; + else + return false; +@@ -2564,13 +2564,24 @@ + 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); ++ foreach ($dn as $key => $rdn) { ++ $a[$key] = preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', ++ function ($m) { ++ return ''.chr(hexdec('\\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 ($m) { ++ return ''.chr(hexdec('\\1')).''; ++ }, ++ $dn ++ ); + } + } + Modified: head/net/phpldapadmin/files/patch-tools__po__Makefile ============================================================================== --- head/net/phpldapadmin/files/patch-tools__po__Makefile Sun Apr 27 09:35:27 2014 (r352408) +++ head/net/phpldapadmin/files/patch-tools__po__Makefile Sun Apr 27 09:51:17 2014 (r352409) @@ -1,5 +1,5 @@ ---- ./tools/po/Makefile.orig 2013-12-17 10:35:33.849229663 +0000 -+++ ./tools/po/Makefile 2013-12-17 10:35:42.989230589 +0000 +--- ./tools/po/Makefile.orig 2012-10-01 07:54:14.000000000 +0100 ++++ ./tools/po/Makefile 2014-04-27 09:40:05.269794411 +0100 @@ -1,4 +1,3 @@ -#!/bin/bash #
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201404270951.s3R9pIDh063243>