[TASK] Log warning on invalid charset 03/54503/5
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 30 Oct 2017 16:20:39 +0000 (17:20 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 28 Nov 2017 23:12:17 +0000 (00:12 +0100)
This gives users a clear hint if e.g. config.metaCharset contains
an invalid value instead of showing a blank page.

Change-Id: I9cdb37cc7e61af10e2d1985ef43f488e53b17a48
Resolves: #82852
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/54503
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Pawel Cieslik <p.cieslik@macopedia.pl>
Reviewed-by: Pawel Cieslik <p.cieslik@macopedia.pl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/core/Classes/Charset/CharsetConverter.php

index ce8ed1d..893cdfb 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Core\Charset;
  */
 
 use TYPO3\CMS\Core\Localization\Locales;
+use TYPO3\CMS\Core\Log\LogManager;
 use TYPO3\CMS\Core\SingletonInterface;
 use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -774,6 +775,9 @@ class CharsetConverter implements SingletonInterface
                 }
                 return 2;
             }
+            GeneralUtility::makeInstance(LogManager::class)
+                ->getLogger(__CLASS__)
+                ->warning('Unknown charset "' . $charset . '" used for settings like config.metaCharset.');
             return false;
         }
         return 1;