68 'Trusted hosts pattern is configured to allow all header values. Check the pattern defined in Admin'
69 .
' Tools -> Settings -> Configure Installation-Wide Options -> System -> trustedHostsPattern'
70 .
' and adapt it to expected host value(s).',
71 'Trusted hosts pattern is insecure',
75 if (GeneralUtility::hostHeaderValueMatchesTrustedHostsPattern($_SERVER[
'HTTP_HOST'])) {
78 'Trusted hosts pattern is configured to allow current host value.'
81 $defaultPort = GeneralUtility::getIndpEnv(
'TYPO3_SSL') ?
'443' :
'80';
83 'The trusted hosts pattern will be configured to allow all header values. This is because your $SERVER_NAME:[defaultPort]'
84 .
' is "' . $_SERVER[
'SERVER_NAME'] .
':' . $defaultPort .
'" while your HTTP_HOST:SERVER_PORT is "'
85 . $_SERVER[
'HTTP_HOST'] .
':' . $_SERVER[
'SERVER_PORT'] .
'". Check the pattern defined in Admin'
86 .
' Tools -> Settings -> Configure Installation-Wide Options -> System -> trustedHostsPattern'
87 .
' and adapt it to expected host value(s).',
88 'Trusted hosts pattern mismatch',
101 $allowUrlFopen = (bool)ini_get(
'allow_url_fopen');
102 $curlEnabled = function_exists(
'curl_version');
103 if ($allowUrlFopen || $curlEnabled) {
106 'Fetching external URLs is allowed'
110 'Either enable PHP runtime setting "allow_url_fopen"' . LF .
'or compile curl into your PHP with --with-curl.',
111 'Fetching external URLs is not allowed',
122 $currentLocale = setlocale(LC_CTYPE, 0);
127 '$GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] is not set. This is fine as long as no UTF-8 file system is used.',
128 'Empty systemLocale setting',
131 } elseif (setlocale(LC_CTYPE,
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemLocale']) ===
false) {
133 'Current value of the $GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] is incorrect. A locale with'
134 .
' this name doesn\'t exist in the operating system.',
135 'Incorrect systemLocale setting',
138 setlocale(LC_CTYPE, $currentLocale);
142 'System locale is correct'
153 if (
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'UTF8filesystem']) {
157 '$GLOBALS[TYPO3_CONF_VARS][SYS][UTF8filesystem] is set, but $GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale]'
158 .
' is empty. Make sure a valid locale which supports UTF-8 is set.',
159 'System locale not set on UTF-8 file system',
163 $testString =
'ÖöĄĆŻĘĆćążąęó.jpg';
164 $currentLocale = setlocale(LC_CTYPE, 0);
166 setlocale(LC_CTYPE,
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'systemLocale']);
167 if (escapeshellarg($testString) === $quote . $testString . $quote) {
170 'File names with UTF-8 characters can be used.'
174 'Please check your $GLOBALS[TYPO3_CONF_VARS][SYS][systemLocale] setting.',
175 'System locale setting doesn\'t support UTF-8 file names.',
179 setlocale(LC_CTYPE, $currentLocale);
184 'Skipping test, as UTF8filesystem is not enabled.'
195 $documentationLink =
'For more information take a look in our documentation ' . TYPO3_URL_WIKI_OPCODECACHE .
'.';
196 $opcodeCaches = GeneralUtility::makeInstance(OpcodeCacheService::class)->getAllActive();
197 if (empty($opcodeCaches)) {
200 'PHP opcode caches hold a compiled version of executed PHP scripts in'
201 .
' memory and do not require to recompile a script each time it is accessed.'
202 .
' This can be a massive performance improvement and can reduce the load on a'
203 .
' server in general. A parse time reduction by factor three for fully cached'
204 .
' pages can be achieved easily if using an opcode cache.'
205 . LF . $documentationLink,
206 'No PHP opcode cache loaded',
212 foreach ($opcodeCaches as $opcodeCache => $properties) {
213 $message .=
'Name: ' . $opcodeCache .
' Version: ' . $properties[
'version'];
215 if ($properties[
'error']) {
217 $message .=
' This opcode cache is marked as malfunctioning by the TYPO3 CMS Team.';
218 } elseif ($properties[
'canInvalidate']) {
219 $message .=
' This opcode cache should work correctly and has good performance.';
225 $message .=
' This opcode cache may work correctly but has medium performance.';
229 $message .= $documentationLink;
233 $title =
'A possibly malfunctioning PHP opcode cache is loaded';
237 $title =
'A PHP opcode cache is loaded';
253 if (function_exists(
'imageftbbox')) {
255 $fontSize = (20 / 96 * 72);
256 $textDimensions = @imageftbbox(
259 __DIR__ .
'/../../Resources/Private/Font/vera.ttf',
260 'Testing true type support'
262 $fontBoxWidth = $textDimensions[2] - $textDimensions[0];
263 if ($fontBoxWidth < 300 && $fontBoxWidth > 200) {
265 'Fonts are rendered by FreeType library. '
266 .
'We need to ensure that the final dimensions are as expected. '
267 .
'This server renderes fonts based on 96 DPI correctly',
268 'FreeType True Type Font DPI'
272 'Fonts are rendered by FreeType library. '
273 .
'This server does not render fonts as expected. '
274 .
'Please check your FreeType 2 module.',
275 'FreeType True Type Font DPI',
281 'The core relies on GD library compiled into PHP with freetype2'
282 .
' support. This is missing on your system. Please install it.',
283 'PHP GD library freetype2 support missing',
294 $sampleArray = [
'Test>><<Data'];
295 $xmlContent =
'<numIndex index="0">Test>><<Data</numIndex>' . LF;
296 $xml = GeneralUtility::array2xml($sampleArray,
'', -1);
297 if ($xmlContent !== $xml) {
299 'Some hosts have problems saving ">><<" in a flexform.'
300 .
' To fix this, enable [BE][flexformForceCDATA] in'
301 .
' All Configuration.',
302 'PHP libxml bug present',
308 'PHP libxml bug not present'