Skip to content

Commit

Permalink
[BUGFIX] Use multibyte method in CodeCompletionController
Browse files Browse the repository at this point in the history
Use mb_strlen & mb_substr to cut off TypoScript to avoid exceptions
if the 20th character is a multibyte value.

Resolves: #90372
Releases: master, 9.5
Change-Id: I8f90aa54a4cb6ede95d4fa50d557aeec4d8cd031
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63255
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
  • Loading branch information
georgringer authored and tmotyl committed Feb 16, 2020
1 parent d108ed7 commit 425c911
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -90,8 +90,8 @@ private function treeWalkCleanup(array $treeBranch)
//type definition or value-assignment
if ($dotCount === 0) {
if ($value != '') {
if (strlen($value) > 20) {
$value = substr($value, 0, 20);
if (mb_strlen($value) > 20) {
$value = mb_substr($value, 0, 20);
}
if (!isset($cleanedTreeBranch[$key])) {
$cleanedTreeBranch[$key] = [];
Expand Down

0 comments on commit 425c911

Please sign in to comment.