From 5cfb15addef2216f4b5beb1bfadafca9254dbf79 Mon Sep 17 00:00:00 2001 From: Stephen Abello Date: Mon, 13 Jul 2026 15:34:59 +0200 Subject: [PATCH] Fix variable types --- core/attributedef.class.inc.php | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index 57f249289e..6a2aee05e9 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -909,13 +909,12 @@ abstract class AttributeDefinition */ public function TrimValue(string $sValue) { - $iMaxSize = $this->GetMaxSize(); - if ($iMaxSize && (strlen($sValue) > $iMaxSize)) - { - $sValue = substr($sValue, 0, $iMaxSize); - } - return $sValue; - } + $iMaxSize = $this->GetMaxSize(); + if ($iMaxSize && (strlen($sValue) > $iMaxSize)) { + $sValue = substr($sValue, 0, $iMaxSize); + } + return $sValue; + } /** * @return mixed|null @@ -4266,10 +4265,10 @@ class AttributeText extends AttributeString public function TrimValue(string $sValue) { $iMaxSize = $this->GetMaxSize(); - $sLength = strlen($sValue); - $sLengthChar = mb_strlen($sValue); - if ($iMaxSize && ($sLength > $iMaxSize)) { - $sMessage = " -truncated ($sLengthChar chars)"; + $iLength = strlen($sValue); + $iLengthChar = mb_strlen($sValue); + if ($iMaxSize && ($iLength > $iMaxSize)) { + $sMessage = " -truncated ($iLengthChar chars)"; $sVal = substr($sValue, 0, $iMaxSize - strlen($sMessage)); //executes the "mb_substr" function to ensure a character is not truncated in the middle.