mirror of
https://github.com/FriendsOfTYPO3/feedit.git
synced 2024-11-22 06:26:09 +01:00
[CLEANUP] Replace strlen() with === for zero length check
It is faster to compare a string with === '' to find out if it's empty than to run strlen() on it. The replacement rules are applied as follows: * if (strlen($str)) => if ((string)$str !== '') * if (!is_string($str) || strlen($str) === 0) => if (!is_string($str) || $str === '') * If it can be seen easily that $str is a string, the typecast is omitted. Change-Id: I888d70e42f925bd57ad23b873b72d6a38acb39ef Resolves: #54091 Releases: master Reviewed-on: http://review.typo3.org/27794 Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de> Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de> Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
This commit is contained in:
parent
f370d50390
commit
9449d24ef8
1 changed files with 3 additions and 1 deletions
|
@ -188,7 +188,9 @@ class FrontendEditPanel {
|
|||
$cBuf = rtrim(preg_replace('/<[^<]*>$/', '', $cBuf));
|
||||
$secureCount--;
|
||||
}
|
||||
$content = strlen($cBuf) && $secureCount ? substr($content, 0, strlen($cBuf)) . $icon . substr($content, strlen($cBuf)) : ($content = $icon . $content);
|
||||
$content = $cBuf !== '' && $secureCount
|
||||
? substr($content, 0, strlen($cBuf)) . $icon . substr($content, strlen($cBuf))
|
||||
: $icon . $content;
|
||||
} else {
|
||||
$content .= $icon;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue