From abd108200b377cfc30bca5fb4a69bdf3d6d84a89 Mon Sep 17 00:00:00 2001 From: Benni Mack <benni@typo3.org> Date: Thu, 7 Sep 2017 16:25:20 +0200 Subject: [PATCH] [TASK] Use TYPO3_OS constant in Services registration There is a comment that TYPO3_OS is not yet defined, which is wrong as it is one of the first things available during bootstrap, so the check can be used directly. Resolves: #82343 Releases: master, 8.7 Change-Id: I01e0aa7a090bc068195b44474f645d09220f8b71 Reviewed-on: https://review.typo3.org/53953 Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl> Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de> Reviewed-by: Andreas Fernandez <typo3@scripting-base.de> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> --- .../core/Classes/Utility/ExtensionManagementUtility.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php b/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php index cddced5c4542..c0f3b752e46a 100644 --- a/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php +++ b/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php @@ -1015,10 +1015,9 @@ class ExtensionManagementUtility // OS check // Empty $os means 'not limited to one OS', therefore a check is not needed if ($GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['available'] && $GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['os'] != '') { - // TYPO3_OS is not yet defined - $os_type = stripos(PHP_OS, 'win') !== false && !stripos(PHP_OS, 'darwin') !== false ? 'WIN' : 'UNIX'; + $os_type = TYPO3_OS === 'WIN' ? 'WIN' : 'UNIX'; $os = GeneralUtility::trimExplode(',', strtoupper($GLOBALS['T3_SERVICES'][$serviceType][$serviceKey]['os'])); - if (!in_array($os_type, $os)) { + if (!in_array($os_type, $os, true)) { self::deactivateService($serviceType, $serviceKey); } } -- GitLab