67471[BUGFIX] Avoid access to missing mbstring functions
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Markus Klein +1
- Martin Kutschker +1
- Mathias Brodala +1
-
Verified V +2 Done
- Christian Kuhn +2
- Markus Klein +1
- TYPO3com +1 CI
Issues 1
Files 2
Review log 1617
-
Simon Gilli uploaded patch set 1 01/20/21, 10:05
-
Mathias Brodala commented on patch set 1 01/20/21, 10:12
-
TYPO3com voted on patch set 1 V +1 01/20/21, 10:14 Completed build in 08m 58s on Wed, 20 Jan, 10:14 AM Test Summary: 32595 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8934
-
Martin Kutschker commented on patch set 1 CR +1 01/20/21, 11:20
DefaultFactory.php:255Replyexplode on 7bit data is safe for UTF8 -
Mathias Brodala commented on patch set 1 01/20/21, 11:29
DefaultFactory.php:255ReplySorry, I don't understand what this means. My impression was that having file paths with special Unicode characters (multi-byte) can lead to issues when explode()'d compared to mb_split()'d. Am I wrong? -
Simon Gilli commented on patch set 1 01/20/21, 12:14
DefaultFactory.php:255Reply"/" uses only 7 bits which can not occur in a upper byte in case of multiple bytes. -
Martin Kutschker commented on patch set 1 01/20/21, 12:21
DefaultFactory.php:255ReplyI don't see why. No 7bit ASCII code is part of a UTF9 multi-byte sequence. So if I split an UTF8-string apart with an ASCII character then the result will always be an array of valid UTF8 strings. And even if I feed any valid UTF8 sequence as separator the result is ok. What does not work is using an 8bit code with the highest bit set (eg a latin1 umlaut). This is not valid in UTF8 and result in an array of invalid strings. The main difference is that mb_split() uses a regexp and is more akin to pre_split with the u switch. -
Martin Kutschker commented on patch set 1 01/20/21, 12:23
DefaultFactory.php:255ReplyOk, I have read only now the PHP tracker entry. The ticket is valid for UTF16 which is a fixed-length 2 byte encoding. explode() will also fail for CJK encodings etc. But explode() is safe for all single-byte encodings and UTF8. -
Martin Kutschker commented on patch set 1 CR -1 01/20/21, 12:32
Indexer.php:1044There is a big difference between mb_string and mb_strcut. The latter cuts at byte position, not character position. If $maxL is measured in characters the string will be too long for the DB. I don't think that any DB other then Mysql accepts strings longer than defined without raising an error. -
Simon Gilli commented on patch set 1 01/20/21, 12:41
Indexer.php:1044ReplyTherefor you can change the configration properly. But if the database has the correct character set this should not be an issue. It's also possible to use a 0 length in the configuration which will not truncate the string at all. Imho this is fine, see also my comment. -
Martin Kutschker commented on patch set 1 CR +1 01/20/21, 13:09
Indexer.php:1044ReplyAck -
Mathias Brodala commented on patch set 1 01/20/21, 13:22
DefaultFactory.php:255ReplyThanks for the insights. :-) -
Mathias Brodala voted on patch set 1 CR +1 01/20/21, 13:24
-
Simon Gilli commented on patch set 1 01/20/21, 13:35
There is also a discussion at Slack see https://typo3.slack.com/archives/C03AM9R17/p1611141607115400 -
Markus Klein voted on patch set 1 V +1 CR +1 02/02/21, 13:48
-
Christian Kuhn voted on patch set 1 V +2 CR +2 02/04/21, 18:26
-
Christian Kuhn merged patch set 2 02/04/21, 18:26
DefaultFactory.php:255