From 9cf2adf8bb543cc5c12e87313431b8f942053789 Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Mon, 9 Jan 2017 13:05:26 +0100 Subject: [PATCH] [FOLLOWUP][TASK] Remove iconv support and use mbstring-polyfill The method csConv->strtrunc() is missing in the deprecation. Resolves: #78670 Releases: master Change-Id: I95284f2ded36f61410806494dd5cd8f1db22c586 Reviewed-on: https://review.typo3.org/51215 Reviewed-by: Markus Klein <markus.klein@typo3.org> Tested-by: Markus Klein <markus.klein@typo3.org> Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Tested-by: Wouter Wolters <typo3@wouterwolters.nl> --- typo3/sysext/core/Classes/Charset/CharsetConverter.php | 4 +++- .../Deprecation-78670-DeprecatedCharsetConverterMethods.rst | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/typo3/sysext/core/Classes/Charset/CharsetConverter.php b/typo3/sysext/core/Classes/Charset/CharsetConverter.php index faa06816fc26..bfababa89934 100644 --- a/typo3/sysext/core/Classes/Charset/CharsetConverter.php +++ b/typo3/sysext/core/Classes/Charset/CharsetConverter.php @@ -317,11 +317,11 @@ class CharsetConverter implements SingletonInterface } // PHP-libs don't support fallback to SGML entities, but UTF-8 handles everything if ($toCharset === 'utf-8' || !$useEntityForNoChar) { + // Returns FALSE for unsupported charsets $convertedString = mb_convert_encoding($inputString, $toCharset, $fromCharset); if (false !== $convertedString) { return $convertedString; } - // Returns FALSE for unsupported charsets } if ($fromCharset !== 'utf-8') { $inputString = $this->utf8_encode($inputString, $fromCharset); @@ -1194,9 +1194,11 @@ class CharsetConverter implements SingletonInterface * @param int $len The byte length * @return string The shortened string * @see mb_strcut() + * @deprecated since TYPO3 v8, will be removed with TYPO3 v9, use mb_strcut() directly */ public function strtrunc($charset, $string, $len) { + GeneralUtility::logDeprecatedFunction(); if ($len <= 0) { return ''; } diff --git a/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst b/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst index 0487c74fcbe1..503ca47aefb0 100644 --- a/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst +++ b/typo3/sysext/core/Documentation/Changelog/8.5/Deprecation-78670-DeprecatedCharsetConverterMethods.rst @@ -14,6 +14,7 @@ Therefore some methods of :php:`CharsetConverter` have been marked as deprecated - :php:`strlen()`: use :php:`mb_strlen()` directly - :php:`substr()`: use :php:`mb_substr()` directly +- :php:`strtrunc()`: use :php:`mb_strcut()` directly - :php:`convCapitalize()`: use :php:`mb_convert_case()` directly - :php:`conv_case()`: use :php:`mb_strtolower()` or :php:`mb_strtoupper()` directly - :php:`utf8_substr()`: use :php:`mb_substr()` directly -- GitLab