From da07fadfb3c9c88dc89245c686c87c084a27c7c9 Mon Sep 17 00:00:00 2001 From: Molkobain Date: Mon, 16 Jan 2023 16:47:26 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B05302=20-=20PHP=208.1:=20Migrate=20some?= =?UTF-8?q?=20strlen()=20usages=20to=20internal=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/Form/Field/BlobField.php | 2 +- sources/Form/Field/EmailField.php | 2 +- sources/Form/Field/ImageField.php | 2 +- sources/Form/Field/PhoneField.php | 2 +- sources/Form/Field/UrlField.php | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sources/Form/Field/BlobField.php b/sources/Form/Field/BlobField.php index 1470bb709..d6a1004d1 100644 --- a/sources/Form/Field/BlobField.php +++ b/sources/Form/Field/BlobField.php @@ -70,7 +70,7 @@ class BlobField extends Field else { $sFilename = $this->currentValue->GetFileName(); - $iSize = utils::BytesToFriendlyFormat(strlen($this->currentValue->GetData())); + $iSize = utils::BytesToFriendlyFormat(utils::Strlen($this->currentValue->GetData())); $sOpenLink = $this->GetDisplayUrl(); $sDownloadLink = $this->GetDownloadUrl(); diff --git a/sources/Form/Field/EmailField.php b/sources/Form/Field/EmailField.php index 1ef669ead..4c8ef856c 100644 --- a/sources/Form/Field/EmailField.php +++ b/sources/Form/Field/EmailField.php @@ -37,7 +37,7 @@ class EmailField extends StringField public function GetDisplayValue() { $sLabel = Str::pure2html($this->currentValue); - if (strlen($sLabel) > 128) + if (utils::StrLen($sLabel) > 128) { // Truncate the length to 128 characters, by removing the middle $sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20); diff --git a/sources/Form/Field/ImageField.php b/sources/Form/Field/ImageField.php index 30feda5a5..d528ae6b3 100644 --- a/sources/Form/Field/ImageField.php +++ b/sources/Form/Field/ImageField.php @@ -41,7 +41,7 @@ class ImageField extends BlobField else { $sFilename = $this->currentValue->GetFileName(); - $iSize = utils::BytesToFriendlyFormat(strlen($this->currentValue->GetData())); + $iSize = utils::BytesToFriendlyFormat(utils::StrLen($this->currentValue->GetData())); $sOpenLink = $this->GetDisplayUrl(); $sDownloadLink = $this->GetDownloadUrl(); diff --git a/sources/Form/Field/PhoneField.php b/sources/Form/Field/PhoneField.php index 6a7d715a8..0e6bd3ae2 100644 --- a/sources/Form/Field/PhoneField.php +++ b/sources/Form/Field/PhoneField.php @@ -37,7 +37,7 @@ class PhoneField extends StringField public function GetDisplayValue() { $sLabel = Str::pure2html($this->currentValue); - if (strlen($sLabel) > 128) + if (utils::StrLen($sLabel) > 128) { // Truncate the length to 128 characters, by removing the middle $sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20); diff --git a/sources/Form/Field/UrlField.php b/sources/Form/Field/UrlField.php index 198d885fc..692101f34 100644 --- a/sources/Form/Field/UrlField.php +++ b/sources/Form/Field/UrlField.php @@ -21,6 +21,7 @@ namespace Combodo\iTop\Form\Field; use Str; use Closure; +use utils; /** * Description of UrlField @@ -58,7 +59,7 @@ class UrlField extends StringField public function GetDisplayValue() { $sLabel = Str::pure2html($this->currentValue); - if (strlen($sLabel) > 128) + if (utils::StrLen($sLabel) > 128) { // Truncate the length to 128 characters, by removing the middle $sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);