phpLDAPadmin icon indicating copy to clipboard operation
phpLDAPadmin copied to clipboard

Error 8192 while running under php7.4

Open hlh-restart opened this issue 5 years ago • 1 comments

First of all thank you for your superb work!!!

Here is the patch that solve this problem:

diff --git a/lib/TemplateRender.php b/lib/TemplateRender.php
index bf6e99d..249c7a1 100644
--- a/lib/TemplateRender.php
+++ b/lib/TemplateRender.php
@@ -200,7 +200,7 @@ class TemplateRender extends PageRender {
                                        $next_number = $vals;
 
                                        foreach ($mod as $calc) {
-                                               $operand = $calc{0};
+                                               $operand = $calc[0];
                                                $operator = substr ($calc,1);
 
                                                switch ($operand) {
diff --git a/lib/functions.php b/lib/functions.php
index e2f125c..f159f8c 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1600,7 +1600,7 @@ function get_icon($server_id,$dn,$object_classes=array()) {
 
   # Return icon filename based upon objectClass value
   if (in_array('sambaaccount',$object_classes) &&
-    '$' == $rdn{ strlen($rdn) - 1 })
+    '$' == $rdn[ strlen($rdn) - 1 ])
     return 'nt_machine.png';
 
   if (in_array('sambaaccount',$object_classes))

hlh-restart avatar Jan 12 '21 13:01 hlh-restart

Brilliant! that solved my issue with php7.4, much thanks!

guymass avatar Apr 24 '21 15:04 guymass