summaryrefslogtreecommitdiff
path: root/net-nds/phpldapadmin/files/phpldapadmin-1.2.6.4-getDN-htmlspecialchars.patch
blob: 0e6ae997fc4810d0c9234060181d50cfaee362f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
https://bugs.gentoo.org/897680

This fixes an error you get under php-8.1 when "$server->getContainer($base->getDN())"
returns a null object (that's the case if you have a short, one component, rootdn in your
"$servers->setValue('server','base',array(...)" config.
--- a/lib/HTMLTree.php
+++ b/lib/HTMLTree.php
@@ -98,7 +98,7 @@
 					$this->javascript .= '<div>';
 					$this->javascript .= '<input type="hidden" name="cmd" value="template_engine" />';
 					$this->javascript .= sprintf('<input type="hidden" name="server_id" value="%s" />',$server->getIndex());
-					$this->javascript .= sprintf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($server->getContainer($base->getDN())));
+					$this->javascript .= sprintf('<input type="hidden" name="container" value="%s" />',htmlspecialchars($server->getContainer($base->getDN()) ?? ''));
 					$this->javascript .= sprintf('<input type="hidden" name="rdn" value="%s" />',get_rdn($base->getDN()));
 					$this->javascript .= sprintf('<input type="hidden" name="rdn_attribute[]" value="%s" />',$rdn[0]);
 					$this->javascript .= sprintf('<input type="hidden" name="new_values[%s][]" value="%s" />',$rdn[0],$rdn[1]);