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 #1

Updated by Steffen Müller over 10 years ago

  • Project changed from 1865 to TYPO3 Core
  • Is Regression set to No

Moved to core issue tracker.

Actions #2

Updated by Wouter Wolters over 9 years ago

  • Status changed from New to Closed

This issue is resolved in 7.x by checking if the variable exists instead of checking the lenth..

Will close this issue now as I think this doesn't need time to be resolved in 6.2

If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.

Actions

Also available in: Atom PDF