From 34d4f2022214780f93e17a5c8dba15cabc8b82b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bennet=20Ble=C3=9Fmann?= Date: Sun, 30 Aug 2020 13:56:25 +0200 Subject: [PATCH] Fixes usage of deprecated array/string access syntax. (#97) PHP 7.4 Compatibility. --- lib/TemplateRender.php | 2 +- lib/export_functions.php | 2 +- lib/functions.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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/export_functions.php b/lib/export_functions.php index d98df2c..7f08b87 100644 --- a/lib/export_functions.php +++ b/lib/export_functions.php @@ -223,7 +223,7 @@ abstract class Export { */ protected function isSafeAscii($str) { for ($i=0;$i 127) + if (ord($str[$i]) < 32 || ord($str[$i]) > 127) return false; return true; diff --git a/lib/functions.php b/lib/functions.php index 784efc9..a16648c 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1638,7 +1638,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))