From 312c3d663bb2222561fc8307ec9bcd933761adf9 Mon Sep 17 00:00:00 2001 From: nilsteampassnet Date: Sun, 12 Nov 2023 11:07:43 +0100 Subject: [PATCH] 3.0.10 Code review fixes --- includes/config/include.php | 2 +- sources/identify.php | 2 +- sources/items.queries.php | 2 +- sources/logs.datatables.php | 2 +- sources/main.functions.php | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/config/include.php b/includes/config/include.php index a3ddd5a2e..55135cb8c 100755 --- a/includes/config/include.php +++ b/includes/config/include.php @@ -17,7 +17,7 @@ */ define('TP_VERSION', '3.0.10'); define("UPGRADE_MIN_DATE", "1697990713"); -define('TP_VERSION_MINOR', '120'); +define('TP_VERSION_MINOR', '121'); define('TP_TOOL_NAME', 'Teampass'); define('TP_ONE_DAY_SECONDS', 86400); define('TP_ONE_WEEK_SECONDS', 604800); diff --git a/sources/identify.php b/sources/identify.php index a9686068c..6a7394c15 100755 --- a/sources/identify.php +++ b/sources/identify.php @@ -1200,7 +1200,7 @@ function authenticateThroughAD(string $username, array $userInfo, string $passwo if ($SETTINGS['ldap_type'] === 'ActiveDirectory') { require_once 'ldap.activedirectory.php'; - if (userIsEnabled($userADInfos['dn'], $connection) === false) { + if (userIsEnabled((string) $userADInfos['dn'], $connection) === false) { return [ 'error' => true, 'message' => "Error : User is not enabled", diff --git a/sources/items.queries.php b/sources/items.queries.php index ad1862864..79a1ab597 100755 --- a/sources/items.queries.php +++ b/sources/items.queries.php @@ -6470,7 +6470,7 @@ // order previous passwords by date $key_values = array_column($previous_passwords, 'date'); - array_multisort($key_values, SORT_DESC, $previous_passwords); + array_multisort($key_values, /** @scrutinizer ignore-type */SORT_DESC, $previous_passwords); // send data echo (string) prepareExchangedData( diff --git a/sources/logs.datatables.php b/sources/logs.datatables.php index 47d1c4e25..6d2194253 100755 --- a/sources/logs.datatables.php +++ b/sources/logs.datatables.php @@ -466,7 +466,7 @@ for ($i = 0; $i < count($aColumns); ++$i) { $sWhere .= $aColumns[$i]." LIKE '%".filter_var($_GET['search']['value'], FILTER_SANITIZE_FULL_SPECIAL_CHARS)."%' OR "; } - $sWhere = substr_replace($sWhere, '', -3).') '; + $sWhere = substr((string) $sWhere, 0, -3).') '; } } diff --git a/sources/main.functions.php b/sources/main.functions.php index 875ba6347..e2484c3c2 100755 --- a/sources/main.functions.php +++ b/sources/main.functions.php @@ -809,7 +809,6 @@ function cacheTableRefresh(): void { // Load class DB loadClasses('DB'); -$superGlobal = new SuperGlobal(); //Load Tree $tree = new NestedTree(prefixTable('nested_tree'), 'id', 'parent_id', 'title');