mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +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
|
else
|
||||||
{
|
{
|
||||||
$sFilename = $this->currentValue->GetFileName();
|
$sFilename = $this->currentValue->GetFileName();
|
||||||
$iSize = utils::BytesToFriendlyFormat(strlen($this->currentValue->GetData()));
|
$iSize = utils::BytesToFriendlyFormat(utils::Strlen($this->currentValue->GetData()));
|
||||||
$sOpenLink = $this->GetDisplayUrl();
|
$sOpenLink = $this->GetDisplayUrl();
|
||||||
$sDownloadLink = $this->GetDownloadUrl();
|
$sDownloadLink = $this->GetDownloadUrl();
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class EmailField extends StringField
|
|||||||
public function GetDisplayValue()
|
public function GetDisplayValue()
|
||||||
{
|
{
|
||||||
$sLabel = Str::pure2html($this->currentValue);
|
$sLabel = Str::pure2html($this->currentValue);
|
||||||
if (strlen($sLabel) > 128)
|
if (utils::StrLen($sLabel) > 128)
|
||||||
{
|
{
|
||||||
// Truncate the length to 128 characters, by removing the middle
|
// Truncate the length to 128 characters, by removing the middle
|
||||||
$sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);
|
$sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class ImageField extends BlobField
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sFilename = $this->currentValue->GetFileName();
|
$sFilename = $this->currentValue->GetFileName();
|
||||||
$iSize = utils::BytesToFriendlyFormat(strlen($this->currentValue->GetData()));
|
$iSize = utils::BytesToFriendlyFormat(utils::StrLen($this->currentValue->GetData()));
|
||||||
$sOpenLink = $this->GetDisplayUrl();
|
$sOpenLink = $this->GetDisplayUrl();
|
||||||
$sDownloadLink = $this->GetDownloadUrl();
|
$sDownloadLink = $this->GetDownloadUrl();
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class PhoneField extends StringField
|
|||||||
public function GetDisplayValue()
|
public function GetDisplayValue()
|
||||||
{
|
{
|
||||||
$sLabel = Str::pure2html($this->currentValue);
|
$sLabel = Str::pure2html($this->currentValue);
|
||||||
if (strlen($sLabel) > 128)
|
if (utils::StrLen($sLabel) > 128)
|
||||||
{
|
{
|
||||||
// Truncate the length to 128 characters, by removing the middle
|
// Truncate the length to 128 characters, by removing the middle
|
||||||
$sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);
|
$sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ namespace Combodo\iTop\Form\Field;
|
|||||||
|
|
||||||
use Str;
|
use Str;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description of UrlField
|
* Description of UrlField
|
||||||
@@ -58,7 +59,7 @@ class UrlField extends StringField
|
|||||||
public function GetDisplayValue()
|
public function GetDisplayValue()
|
||||||
{
|
{
|
||||||
$sLabel = Str::pure2html($this->currentValue);
|
$sLabel = Str::pure2html($this->currentValue);
|
||||||
if (strlen($sLabel) > 128)
|
if (utils::StrLen($sLabel) > 128)
|
||||||
{
|
{
|
||||||
// Truncate the length to 128 characters, by removing the middle
|
// Truncate the length to 128 characters, by removing the middle
|
||||||
$sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);
|
$sLabel = substr($sLabel, 0, 100).'.....'.substr($sLabel, -20);
|
||||||
|
|||||||
Reference in New Issue
Block a user