From 5fd3eb21f16ef8875192f0dd97c97e216f36398f Mon Sep 17 00:00:00 2001 From: Rom1-B Date: Thu, 12 Mar 2026 08:21:12 +0100 Subject: [PATCH] Fix rector --- ajax/dropdownReplaceFindDevice.php | 6 +++--- inc/replace.class.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ajax/dropdownReplaceFindDevice.php b/ajax/dropdownReplaceFindDevice.php index 054baf3..85cbf49 100644 --- a/ajax/dropdownReplaceFindDevice.php +++ b/ajax/dropdownReplaceFindDevice.php @@ -83,7 +83,7 @@ if ( isset($_REQUEST['searchText']) - && strlen($_REQUEST['searchText']) > 0 + && (string) $_REQUEST['searchText'] !== '' && $_REQUEST['searchText'] != $CFG_GLPI["ajax_wildcard"] ) { // isset already makes sure the search value isn't null @@ -143,7 +143,7 @@ ); } - if ((strlen((string) $withoutput) > 0) && ($withoutput != ' ')) { + if (((string) $withoutput !== '') && ($withoutput != ' ')) { $outputval = sprintf(__s('%1$s - %2$s'), $outputval, $withoutput); } } @@ -160,7 +160,7 @@ if ( $_SESSION["glpiis_ids_visible"] - || (strlen((string) $outputval) == 0) + || ((string) $outputval === '') ) { $outputval = sprintf(__s('%1$s (%2$s)'), $outputval, $ID); } diff --git a/inc/replace.class.php b/inc/replace.class.php index b6aaf87..6c533ee 100644 --- a/inc/replace.class.php +++ b/inc/replace.class.php @@ -464,7 +464,7 @@ public static function replace($type, $model_id, $tab_ids, $location) } // Location - if ((int) $location != 0 && $olditem->isField('locations_id')) { + if ((int) $location !== 0 && $olditem->isField('locations_id')) { $olditem->getFromDB($olditem_id); switch ($location) { case -1: