Bug #79684

Extbase validator StringLength fails on counting the length of text with umlauts

Added by Karsten Nowak (undkonsorten) over 2 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Must have
Assignee:
Category:
Extbase
Target version:
-
Start date:
2017-02-08
Due date:
% Done:

100%

TYPO3 Version:
7
PHP Version:
5.6
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

In extbase StringLength validator on line 59 $stringLength = strlen($value); the length is wrong if umlaute (ä,ö,ü) in text. Probably also with other multibyte characters in text.

We fixed this quickly by using mb_strlen instead of strlen in our own extension and overwrite the StringLengthValidator class.

Is mb_strlen the solution for this problem? Is it planned to fix this problem in the validator soon?

Associated revisions

Revision 4ba68112 (diff)
Added by Georg Ringer over 2 years ago

[BUGFIX] Use mb_strlen in StringLengthValidator

By using mb_strlen for checking the length, the
check counts multibyte values now correctly.

Resolves: #79684
Releases: master
Change-Id: Idcc9fc6e77d0cd42bc43986acb956af67da2453d
Reviewed-on: https://review.typo3.org/51593
Reviewed-by: Stephan Großberndt <>
Tested-by: TYPO3com <>
Reviewed-by: Philipp Gampe <>
Tested-by: Philipp Gampe <>
Reviewed-by: Mona Muzaffar <>
Tested-by: Mona Muzaffar <>
Reviewed-by: Mathias Brodala <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

History

#1 Updated by Georg Ringer over 2 years ago

  • Status changed from New to Accepted
  • Assignee set to Georg Ringer

#2 Updated by Gerrit Code Review over 2 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51593

#3 Updated by Georg Ringer over 2 years ago

hopefully soon enough! ;)

#4 Updated by Karsten Nowak (undkonsorten) over 2 years ago

Yes, I think it's soon enough. Thx.
I'm wondering that nobody else had this problem before. Maybe nobody checked lengths of strings so close to the limit. We found this bug because on our validation were two characters be left to the limit and 6 umlauts in text ;-).

#5 Updated by Gerrit Code Review over 2 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/51593

#6 Updated by Georg Ringer over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF