Project

General

Profile

Actions

Bug #60993

closed

Notice in charset converter

Added by Attila Szeremi over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-08-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

https://github.com/TYPO3/TYPO3.CMS/blob/afa3e7f8285f4e30a8a4fbc163fdf616b4e43b80/typo3/sysext/core/Classes/Charset/CharsetConverter.php#L2066
and
https://github.com/TYPO3/TYPO3.CMS/blob/afa3e7f8285f4e30a8a4fbc163fdf616b4e43b80/typo3/sysext/core/Classes/Charset/CharsetConverter.php#L2076

`$str[$i]` triggers a notice if the string is too short, which it shouldn't be doing especially since the method calling this method is a string shortener (to shorten the string and append "..." if it's too long).

Suggestion:

instead of:

if (strlen($str[$i])) ...
if (strlen($str[$i])) ...

do:

$lastIndex = strlen($str) - 1;
if ($i <= $lastIndex) ...
if ($i <= $lastIndex) ...
Actions

Also available in: Atom PDF