mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-12 23:14:18 +01:00
N°5302 - PHP 8.1: Migrate some strlen() usages to internal method
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user