Project

General

Profile

Actions

Bug #21323

closed

t3lib_cs::cropMbstring has problems with negative length

Added by Steffen Gebert about 15 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2009-10-21
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

function cropMbstring($charset, $string, $len, $crop = '')

as always, $len can also be negative and is correctly handled.

But the check, weather the string should really be truncated is as followed:
if (intval($len) == 0 || mb_strlen($string) < $len) {
return $string;
}

So, if $len < 0, we never return here, but later prepend "...".

Solution: check length < abs($len)

One example, where this can be seen is the pagepath on the top right.
(issue imported from #M12297)


Files

Bildschirmfoto 2009-10-21 um 10.19.26.png (9.25 KB) Bildschirmfoto 2009-10-21 um 10.19.26.png Administrator Admin, 2009-10-21 10:20
12297.diff (619 Bytes) 12297.diff Administrator Admin, 2009-10-21 10:22
12297_v2.diff (488 Bytes) 12297_v2.diff Administrator Admin, 2009-11-25 13:01
Actions

Also available in: Atom PDF