git: a5bd98809b0e - main - net/phpldapadmin: Fix runtime with php82

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 12 Nov 2023 19:23:16 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a5bd98809b0edbc0bb0e76e7d703e0f08efa515e

commit a5bd98809b0edbc0bb0e76e7d703e0f08efa515e
Author:     Krzysztof <ports@bsdserwis.com>
AuthorDate: 2023-11-12 19:03:48 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-11-12 19:23:01 +0000

    net/phpldapadmin: Fix runtime with php82
    
    phpldapadmin needs some more patches to work correctly (without
    error/warning messages in webserver logs).
    
    PR:             274970
---
 net/phpldapadmin/Makefile                         |  4 ++--
 net/phpldapadmin/files/patch-lib_ds__ldap.php     | 11 +++++++++++
 net/phpldapadmin/files/patch-lib_xmlTemplates.php | 11 +++++++++++
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/net/phpldapadmin/Makefile b/net/phpldapadmin/Makefile
index 27e9f5036850..4b1908c6346b 100644
--- a/net/phpldapadmin/Makefile
+++ b/net/phpldapadmin/Makefile
@@ -1,12 +1,12 @@
 PORTNAME=	phpldapadmin
 DISTVERSION=	1.2.6.6
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net www
 PKGNAMESUFFIX=	${PHP_PKGNAMESUFFIX}
 
 MAINTAINER=	ports@bsdserwis.com
 COMMENT=	PHP application to administer LDAP over the web
-WWW=		https://phpldapadmin.sourceforge.net/
+WWW=		https://github.com/leenooks/phpLDAPadmin/wiki
 
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/LICENSE
diff --git a/net/phpldapadmin/files/patch-lib_ds__ldap.php b/net/phpldapadmin/files/patch-lib_ds__ldap.php
new file mode 100644
index 000000000000..41dfc700729a
--- /dev/null
+++ b/net/phpldapadmin/files/patch-lib_ds__ldap.php
@@ -0,0 +1,11 @@
+--- lib/ds_ldap.php.orig	2023-04-01 13:46:16 UTC
++++ lib/ds_ldap.php
+@@ -991,7 +991,7 @@ class ldap extends DS {
+ 		$return = $dn;
+ 
+ 		foreach ($this->getBaseDN() as $base) {
+-			if (preg_match("/${base}$/i",$dn)) {
++			if (preg_match("/{$base}$/i",$dn)) {
+ 				$return = $base;
+ 				break;
+ 			}
diff --git a/net/phpldapadmin/files/patch-lib_xmlTemplates.php b/net/phpldapadmin/files/patch-lib_xmlTemplates.php
new file mode 100644
index 000000000000..26ee3c3f4215
--- /dev/null
+++ b/net/phpldapadmin/files/patch-lib_xmlTemplates.php
@@ -0,0 +1,11 @@
+--- lib/xmlTemplates.php.orig	2023-04-01 13:46:16 UTC
++++ lib/xmlTemplates.php
+@@ -122,7 +122,7 @@ abstract class xmlTemplates {
+ 
+ 					# Ignore any files that are not the predefined custom files.
+ 					if ($_SESSION[APPCONFIG]->getValue('appearance','custom_templates_only')
+-						&& ! preg_match("/^${custom_prefix}/",$file))
++						&& ! preg_match("/^{$custom_prefix}/",$file))
+ 						continue;
+ 
+ 					$filename = sprintf('%s/%s',$dir,$file);