diff --git a/Build/gitlab-ci/nightly/integrity.yml b/Build/gitlab-ci/nightly/integrity.yml index 925ca61ca36c48300e23cd911ac3ed331d387c72..6045c74dbcf4ad55f22524582926d82c7ecc111b 100644 --- a/Build/gitlab-ci/nightly/integrity.yml +++ b/Build/gitlab-ci/nightly/integrity.yml @@ -96,3 +96,15 @@ phpstan php 7.4: script: - Build/Scripts/runTests.sh -s composerInstall -p 7.4 - Build/Scripts/runTests.sh -s phpstan -p 7.4 + +phpstan php 8.0: + stage: integrity + only: + - schedules + cache: + key: master-composer-phpstan-80 + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstall -p 8.0 + - Build/Scripts/runTests.sh -s phpstan -p 8.0 diff --git a/Build/gitlab-ci/pre-merge/integrity.yml b/Build/gitlab-ci/pre-merge/integrity.yml index 457c486d265b2d5a7d7181823a962c9cf230e47b..ca9e3d12326a6d083d1ab8820bb826ca0c27d486 100644 --- a/Build/gitlab-ci/pre-merge/integrity.yml +++ b/Build/gitlab-ci/pre-merge/integrity.yml @@ -98,3 +98,17 @@ phpstan php 7.4 pre-merge: - Build/Scripts/runTests.sh -s composerInstall -p 7.4 - Build/Scripts/runTests.sh -s phpstan -p 7.4 +phpstan php 8.0 pre-merge: + stage: main + except: + refs: + - schedules + - master + cache: + key: master-composer-phpstan-80 + paths: + - .cache + script: + - Build/Scripts/runTests.sh -s composerInstall -p 8.0 + - Build/Scripts/runTests.sh -s phpstan -p 8.0 + diff --git a/Build/phpstan.php7config.php b/Build/phpstan.php7config.php new file mode 100644 index 0000000000000000000000000000000000000000..b9eb197d610b37d104424e1ae0b19c3393c916ad --- /dev/null +++ b/Build/phpstan.php7config.php @@ -0,0 +1,28 @@ +<?php + +declare(strict_types=1); + +$config = []; + +if (PHP_MAJOR_VERSION === 7) { + $config['parameters']['ignoreErrors'] = [ + '#Class GdImage not found.#', + [ + 'message' => '#^Parameter \\#[1-4]{1} \\$[a-z]* of function [a-z_]* expects resource, resource\\|XmlParser given\\.$#', + 'path' => '../typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPushParser.php', + 'count' => 9, + ], + [ + 'message' => '#^Parameter \\#1 \\$sem_identifier of function sem_release expects resource, resource\\|SysvSemaphore given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#1 \\$sem_identifier of function sem_remove expects resource, resource\\|SysvSemaphore given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php', + 'count' => 1, + ] + ]; +} + +return $config; diff --git a/Build/phpstan.php8config.php b/Build/phpstan.php8config.php new file mode 100644 index 0000000000000000000000000000000000000000..3ec4d42a82991e33f2806090a5385e4b35f6f07f --- /dev/null +++ b/Build/phpstan.php8config.php @@ -0,0 +1,102 @@ +<?php + +declare(strict_types=1); + +$config = []; + +if (PHP_MAJOR_VERSION === 8) { + $config['parameters']['ignoreErrors'] = [ + [ + 'message' => '#^Parameter \\#1 \\$image of function imagedestroy expects GdImage, GdImage\\|false given\\.$#', + 'path' => '../typo3/sysext/install/Classes/SystemEnvironment/Check.php', + 'count' => 3, + ], + [ + 'message' => '#^Parameter \\#6 \\$color of function imagefilledrectangle expects int, int\\|false given\\.$#', + 'path' => '../typo3/sysext/install/Classes/Controller/EnvironmentController.php', + 'count' => 4, + ], + [ + 'message' => '#^Parameter \\#1 \\$image of function imagefilledrectangle expects GdImage, GdImage\\|false given\\.$#', + 'path' => '../', + 'count' => 4, + ], + [ + 'message' => '#^Parameter \\#1 \\$image of function imagegif expects GdImage, GdImage\\|false given\\.$#', + 'path' => '../', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#6 \\$color of function imagettftext expects int, int\\|false given\\.$#', + 'path' => '../', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#1 \\$image of function imagettftext expects GdImage, GdImage\\|false given\\.$#', + 'path' => '../', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#1 \\$image of function imagecolorallocate expects GdImage, GdImage\\|false given\\.$#', + 'path' => '../', + 'count' => 6, + ], + [ + 'message' => '#^Parameter \\#2 \\$color of function imagecolortransparent expects int\\|null, int\\|false given\\.$#', + 'path' => '../typo3/sysext/frontend/Classes/Imaging/GifBuilder.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#6 \\$color of function imagefilledrectangle expects int, int\\|false given\\.$#', + 'path' => '../typo3/sysext/frontend/Classes/Imaging/GifBuilder.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#4 \\$color of function imagefill expects int, int\\|false given\\.$#', + 'path' => '../typo3/sysext/frontend/Classes/Imaging/GifBuilder.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#[1-4]{1} \\$[a-z]* of function [a-z_]* expects XmlParser, resource\\|XmlParser given\\.$#', + 'path' => '../typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPushParser.php', + 'count' => 9, + ], + [ + 'message' => '#^Parameter \\#1 \\$semaphore of function sem_release expects SysvSemaphore, resource\\|SysvSemaphore given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#1 \\$semaphore of function sem_remove expects SysvSemaphore, resource\\|SysvSemaphore given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#1 \\$function of class ReflectionFunction constructor expects Closure\\|string, callable\\(\\)\\: mixed given\\.$#', + 'path' => '../typo3/sysext/core/Classes/DependencyInjection/ServiceProviderCompilationPass.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#1 \\$value of function count expects array\\|Countable, string given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Database/QueryGenerator.php', + 'count' => 2, + ], + [ + 'message' => '#^Parameter \\#1 \\$array of function array_slice expects array, string given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Database/QueryGenerator.php', + 'count' => 2, + ], + [ + 'message' => '#^Parameter \\#1 \\$callback of function set_exception_handler expects \\(callable\\(Throwable\\)\\: void\\)\\|null, array\\(\\$this\\(TYPO3\\\\CMS\\\\Core\\\\Error\\\\DebugExceptionHandler\\), \'handleException\'\\) given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Error/DebugExceptionHandler.php', + 'count' => 1, + ], + [ + 'message' => '#^Parameter \\#1 \\$callback of function set_exception_handler expects \\(callable\\(Throwable\\)\\: void\\)\\|null, array\\(\\$this\\(TYPO3\\\\CMS\\\\Core\\\\Error\\\\ProductionExceptionHandler\\), \'handleException\'\\) given\\.$#', + 'path' => '../typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php', + 'count' => 1, + ], + ]; +} + +return $config; diff --git a/phpstan.neon b/phpstan.neon index e70d5f8f3461622038823ccbf1f0513b68d12980..2786c8fa3e94850af135b7b212ef45784ded53d5 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,8 @@ includes: - vendor/friendsoftypo3/phpstan-typo3/extension.neon - Build/phpstan.level8.neon + - Build/phpstan.php7config.php + - Build/phpstan.php8config.php # Include bleeding edge rules if necessary but do not commit # - vendor/phpstan/phpstan/conf/bleedingEdge.neon @@ -33,10 +35,9 @@ parameters: - %currentWorkingDirectory%/typo3/sysext/*/Documentation/* - %currentWorkingDirectory%/typo3/sysext/*/Resources/* - %currentWorkingDirectory%/typo3/sysext/*/Configuration/* + - %currentWorkingDirectory%/typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php ignoreErrors: - # PHP8 compatibility, as phpstan cannot detect this yet. - - "#Class GdImage not found.#" - "#^Parameter \\#1 \\$disable of function libxml_disable_entity_loader expects bool, bool\\|null given\\.$#" # ignored errors for level 0 @@ -179,86 +180,6 @@ parameters: message: "#^Parameter \\#1 \\$constraint of static method TYPO3\\\\CMS\\\\Core\\\\Database\\\\Query\\\\QueryHelper\\:\\:stripLogicalOperatorPrefix\\(\\) expects string, string\\|null given\\.$#" count: 1 path: typo3/sysext/core/Classes/Database/QueryView.php - - - message: "#^Parameter \\#1 \\$im of function imagesavealpha expects resource, resource\\|false given\\.$#" - count: 3 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagecolorallocatealpha expects resource, resource\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagefill expects resource, resource\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#4 \\$col of function imagefill expects int, int\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagecolorallocate expects resource, resource\\|false given\\.$#" - count: 11 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagefilledrectangle expects resource, resource\\|false given\\.$#" - count: 11 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#6 \\$col of function imagefilledrectangle expects int, int\\|false given\\.$#" - count: 12 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$dst_im of function imagecopyresized expects resource, resource\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#6 \\$Fcolor of method TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\GraphicalFunctions\\:\\:SpacedImageTTFText\\(\\) expects int, int\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#6 \\$color of method TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\GraphicalFunctions\\:\\:renderTTFText\\(\\) expects int, int\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$destImg of method TYPO3\\\\CMS\\\\Core\\\\Imaging\\\\GraphicalFunctions\\:\\:ImageWrite\\(\\) expects resource, resource\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagedestroy expects resource, resource\\|false given\\.$#" - count: 3 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#6 \\$col of function imagettftext expects int, int\\|false given\\.$#" - count: 1 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#6 \\$color of function imagefilledellipse expects int, int\\|false given\\.$#" - count: 1 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#4 \\$green of function imagecolorset expects int, float given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#5 \\$blue of function imagecolorset expects int, float given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagegif expects resource, resource\\|false given\\.$#" - count: 2 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagestring expects resource, resource\\|false given\\.$#" - count: 3 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#6 \\$col of function imagestring expects int, int\\|false given\\.$#" - count: 3 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - - - message: "#^Parameter \\#1 \\$im of function imagepng expects resource, resource\\|false given\\.$#" - count: 1 - path: typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php - message: "#^Parameter \\#2 \\$id of method TYPO3\\\\CMS\\\\Core\\\\DataHandling\\\\DataHandler\\:\\:getRecordProperties\\(\\) expects int, int\\|string given\\.$#" count: 2 @@ -336,15 +257,15 @@ parameters: count: 1 path: typo3/sysext/frontend/Classes/ContentObject/ScalableVectorGraphicsContentObject.php - - message: "#^Parameter \\#1 \\$array_arg of function current expects array, object given\\.$#" + message: "#^Parameter \\#1 \\$(array_arg|array) of function current expects array, object given\\.$#" count: 1 path: typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php - - message: "#^Parameter \\#1 \\$array_arg of function key expects array, object given\\.$#" + message: "#^Parameter \\#1 \\$(array_arg|array) of function key expects array, object given\\.$#" count: 1 path: typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php - - message: "#^Parameter \\#1 \\$array_arg of function next expects array, object given\\.$#" + message: "#^Parameter \\#1 \\$(array_arg|array) of function next expects array, object given\\.$#" count: 1 path: typo3/sysext/extbase/Classes/Persistence/Generic/LazyLoadingProxy.php - diff --git a/typo3/sysext/core/Classes/DataHandling/DataHandler.php b/typo3/sysext/core/Classes/DataHandling/DataHandler.php index c62c39d764b952be7ee15833606c51d546ca08bd..8bf3f22867b5860aed022a4f948926d8441b1979 100644 --- a/typo3/sysext/core/Classes/DataHandling/DataHandler.php +++ b/typo3/sysext/core/Classes/DataHandling/DataHandler.php @@ -6166,7 +6166,10 @@ class DataHandler implements LoggerAwareInterface } // Process the arguments with the defined function: if (!empty($remapAction['func'])) { - $newValue = call_user_func_array([$this, $remapAction['func']], $remapAction['args']); + $callable = [$this, $remapAction['func']]; + if (is_callable($callable)) { + $newValue = call_user_func_array($callable, $remapAction['args']); + } } // If array is returned, check for maxitems condition, if string is returned this was already done: if (is_array($newValue)) { diff --git a/typo3/sysext/core/Classes/Database/QueryGenerator.php b/typo3/sysext/core/Classes/Database/QueryGenerator.php index 8a0bfc2124ecdba0826cd40c1b743c301285b4f4..f6b2563ee69fc2da0342f428767d87c6fec30f02 100644 --- a/typo3/sysext/core/Classes/Database/QueryGenerator.php +++ b/typo3/sysext/core/Classes/Database/QueryGenerator.php @@ -1294,7 +1294,7 @@ class QueryGenerator return false; } $format = 'Y-m-d\\TH:i:s\\Z'; - $formattedDate = \DateTime::createFromFormat($format, $date); + $formattedDate = \DateTime::createFromFormat($format, (string)$date); return $formattedDate && $formattedDate->format($format) === $date; } @@ -1345,7 +1345,7 @@ class QueryGenerator $inputVal = $this->cleanInputVal($conf, '1'); $qsTmp = str_replace('#VALUE1#', trim($queryBuilder->quote($inputVal), '\''), $qsTmp); } - $qs .= trim($qsTmp); + $qs .= trim((string)$qsTmp); return $qs; } @@ -1698,7 +1698,7 @@ class QueryGenerator */ protected function getDateTimePickerField($name, $timestamp, $type) { - $value = strtotime($timestamp) ? date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], strtotime($timestamp)) : ''; + $value = strtotime($timestamp) ? date($GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm'] . ' ' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['ddmmyy'], (int)strtotime($timestamp)) : ''; $id = StringUtility::getUniqueId('dt_'); $html = []; $html[] = '<div class="input-group" id="' . $id . '-wrapper">'; diff --git a/typo3/sysext/core/Classes/Database/QueryView.php b/typo3/sysext/core/Classes/Database/QueryView.php index b8a6e966cce61fac2748349be547e1e0f3816f69..2b304999e4be969c6a9aed6f32d0337e375ef8cc 100644 --- a/typo3/sysext/core/Classes/Database/QueryView.php +++ b/typo3/sysext/core/Classes/Database/QueryView.php @@ -843,15 +843,15 @@ class QueryView switch ($fields['type']) { case 'date': if ($fieldValue != -1) { - $out = strftime('%d-%m-%Y', $fieldValue); + $out = strftime('%d-%m-%Y', (int)$fieldValue); } break; case 'time': if ($fieldValue != -1) { if ($splitString === '<br />') { - $out = strftime('%H:%M' . $splitString . '%d-%m-%Y', $fieldValue); + $out = strftime('%H:%M' . $splitString . '%d-%m-%Y', (int)$fieldValue); } else { - $out = strftime('%H:%M %d-%m-%Y', $fieldValue); + $out = strftime('%H:%M %d-%m-%Y', (int)$fieldValue); } } break; diff --git a/typo3/sysext/core/Classes/Error/DebugExceptionHandler.php b/typo3/sysext/core/Classes/Error/DebugExceptionHandler.php index 320784c7517b8286c6999f357aefc250cc92e7ba..5159286e7755dc16a1e8c415fbe8342681c8af73 100644 --- a/typo3/sysext/core/Classes/Error/DebugExceptionHandler.php +++ b/typo3/sysext/core/Classes/Error/DebugExceptionHandler.php @@ -31,7 +31,10 @@ class DebugExceptionHandler extends AbstractExceptionHandler */ public function __construct() { - set_exception_handler([$this, 'handleException']); + $callable = [$this, 'handleException']; + if (is_callable($callable)) { + set_exception_handler($callable); + } } /** diff --git a/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php b/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php index c81a6f15f6b445f24fda82cf1ebe9fb59349c95a..94bbb9e8acaa5f5ad36e7d9a624e6dff22db9ebf 100644 --- a/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php +++ b/typo3/sysext/core/Classes/Error/ProductionExceptionHandler.php @@ -47,7 +47,10 @@ class ProductionExceptionHandler extends AbstractExceptionHandler */ public function __construct() { - set_exception_handler([$this, 'handleException']); + $callable = [$this, 'handleException']; + if (is_callable($callable)) { + set_exception_handler($callable); + } } /** diff --git a/typo3/sysext/core/Classes/Http/Stream.php b/typo3/sysext/core/Classes/Http/Stream.php index 15f4a028c490eb12ac532446f6430a7008a57008..093d964428c941e207db884f5c8134fc926accf0 100644 --- a/typo3/sysext/core/Classes/Http/Stream.php +++ b/typo3/sysext/core/Classes/Http/Stream.php @@ -93,6 +93,9 @@ class Stream implements StreamInterface return; } $resource = $this->detach(); + if ($resource === null) { + return; + } fclose($resource); } diff --git a/typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php b/typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php index ae5c42b378ab174b357c015a2bcf67a9e358b99f..70e27b9ed15c46362e0464a151f1b904cac50dd2 100644 --- a/typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php +++ b/typo3/sysext/core/Classes/Locking/SemaphoreLockStrategy.php @@ -37,7 +37,7 @@ class SemaphoreLockStrategy implements LockingStrategyInterface protected $id; /** - * @var resource Semaphore Resource used for this lock + * @var resource|\SysvSemaphore Semaphore Resource used for this lock */ protected $resource; diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php index 4d1e6590123a24dbe3b299b7575e6048a4999b16..047b61762624eabf0d45095f6dda231f2bfd7595 100644 --- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php +++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php @@ -1746,7 +1746,7 @@ class GeneralUtility $targetPermissions = str_pad($targetPermissions, 4, '0', STR_PAD_LEFT); $targetPermissions = octdec($targetPermissions); // "@" is there because file is not necessarily OWNED by the user - $result = @chmod($path, $targetPermissions); + $result = @chmod($path, (int)$targetPermissions); } // Set createGroup if not empty if ( @@ -1870,7 +1870,7 @@ class GeneralUtility */ public static function mkdir($newFolder) { - $result = @mkdir($newFolder, octdec($GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'])); + $result = @mkdir($newFolder, (int)octdec($GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'])); if ($result) { static::fixPermissions($newFolder); } @@ -1915,7 +1915,7 @@ class GeneralUtility { $currentPath = $fullDirectoryPath; $firstCreatedPath = ''; - $permissionMask = octdec($GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask']); + $permissionMask = (int)octdec($GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask']); if (!@is_dir($currentPath)) { do { $firstCreatedPath = $currentPath; diff --git a/typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPushParser.php b/typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPushParser.php index 2188aeb8755e7636ba65d0a42f30037977dee153..fe0411adbb3ff04641f4e603fb8b845346309c70 100644 --- a/typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPushParser.php +++ b/typo3/sysext/extensionmanager/Classes/Utility/Parser/ExtensionXmlPushParser.php @@ -63,7 +63,7 @@ class ExtensionXmlPushParser extends AbstractExtensionXmlParser public function parseXml($file) { $this->createParser(); - if (!is_resource($this->objXml)) { + if (!is_resource($this->objXml) && !$this->objXml instanceof \XmlParser) { throw new ExtensionManagerException('Unable to create XML parser.', 1342640663); } // Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept @@ -72,8 +72,8 @@ class ExtensionXmlPushParser extends AbstractExtensionXmlParser $previousValueOfEntityLoader = libxml_disable_entity_loader(true); } // keep original character case of XML document - xml_parser_set_option($this->objXml, XML_OPTION_CASE_FOLDING, false); - xml_parser_set_option($this->objXml, XML_OPTION_SKIP_WHITE, false); + xml_parser_set_option($this->objXml, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($this->objXml, XML_OPTION_SKIP_WHITE, 0); xml_parser_set_option($this->objXml, XML_OPTION_TARGET_ENCODING, 'utf-8'); xml_set_element_handler($this->objXml, [$this, 'startElement'], [$this, 'endElement']); xml_set_character_data_handler($this->objXml, [$this, 'characterData']); diff --git a/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php b/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php index cb4b90ecf40378d3b2c487cd885026f950f100aa..de9b693cb9d69df0c88cd045a5f82152306e5ba1 100644 --- a/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php +++ b/typo3/sysext/install/Classes/FolderStructure/AbstractNode.php @@ -149,7 +149,7 @@ abstract class AbstractNode 1366744035 ); } - $result = @chmod($this->getAbsolutePath(), octdec($this->getTargetPermission())); + $result = @chmod($this->getAbsolutePath(), (int)octdec($this->getTargetPermission())); if ($result === true) { return new FlashMessage( '', diff --git a/typo3/sysext/scheduler/Classes/CronCommand/NormalizeCommand.php b/typo3/sysext/scheduler/Classes/CronCommand/NormalizeCommand.php index 385138ec5d59627e713309e6a15484dad51a2ba4..9edbe7e4c0e0b1aa15a421f0f3f0c393f3fab08d 100644 --- a/typo3/sysext/scheduler/Classes/CronCommand/NormalizeCommand.php +++ b/typo3/sysext/scheduler/Classes/CronCommand/NormalizeCommand.php @@ -354,7 +354,7 @@ class NormalizeCommand } if (!$normalizedWeekday) { // Convert string representation like 'sun' to integer - $timestamp = strtotime('next ' . $weekday, mktime(0, 0, 0, 1, 1, 2010)); + $timestamp = strtotime('next ' . $weekday, (int)mktime(0, 0, 0, 1, 1, 2010)); if (!$timestamp || $timestamp < strtotime('2010-01-01') || $timestamp > strtotime('2010-01-08')) { throw new \InvalidArgumentException('Unable to convert given weekday name.', 1291163589); }