[BUGFIX] Fix deletion of invalid tasks 73/56973/2
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:43:50 +0000 (11:43 +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/56973
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/scheduler/Classes/Scheduler.php

index 0d3f16e..2b81ce7 100644 (file)
@@ -446,7 +446,7 @@ class Scheduler implements \TYPO3\CMS\Core\SingletonInterface
      */
     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';
     }
 
     /**