[BUGFIX] Fix deletion of invalid tasks 59/56959/3
authorMathias Brodala <mbrodala@pagemachine.de>
Mon, 14 May 2018 09:37:57 +0000 (11:37 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 16 May 2018 09:29:43 +0000 (11:29 +0200)
If the class of a registered task is missing, e.g. because the related
extension has been removed, the task itself will be unserialized into
an __PHP_Incomplete_Class object. Checking the task execution is an
invalid access in this case and must be avoided for such tasks to be
deleted.

Resolves: #84973
Releases: master, 8.7
Change-Id: Iaec8a5e346a0d6257a942cbead50b214036ed700
Reviewed-on: https://review.typo3.org/56959
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/scheduler/Classes/Scheduler.php

index d43ea2a..4bc03bd 100644 (file)
@@ -434,7 +434,7 @@ class Scheduler implements SingletonInterface, LoggerAwareInterface
      */
     public function isValidTaskObject($task)
     {
-        return get_class($task->getExecution()) !== '__PHP_Incomplete_Class' && $task instanceof Task\AbstractTask;
+        return $task instanceof Task\AbstractTask && get_class($task->getExecution()) !== '__PHP_Incomplete_Class';
     }
 
     /**