Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2022-05-31 09:31:38 +0300
committerJohn Molakvoæ (Rebase PR Action) <skjnldsv@users.noreply.github.com>2022-05-31 18:24:30 +0300
commitb17c4a60727ac66e05102399b4b9cdd5ce7cf725 (patch)
tree09b9c12761ceddce30170a204ffe1e089062ac22 /lib
parentdf89e7fd393706b1099cbc7345dcb1f069142e43 (diff)
Check background job type
It is assumed that a job class loaded from the jobs table is an IJob, but due to programming error the job might be of another type. Then the setters will most likely fail. This patch adds an interface type check so only correct jobs are used, anything else is ignored. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/BackgroundJob/JobList.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/BackgroundJob/JobList.php b/lib/private/BackgroundJob/JobList.php
index fe65a1879bc..7ab86df8455 100644
--- a/lib/private/BackgroundJob/JobList.php
+++ b/lib/private/BackgroundJob/JobList.php
@@ -311,6 +311,10 @@ class JobList implements IJobList {
}
}
+ if (!($job instanceof IJob)) {
+ // This most likely means an invalid job was enqueued. We can ignore it.
+ return null;
+ }
$job->setId((int) $row['id']);
$job->setLastRun((int) $row['last_run']);
$job->setArgument(json_decode($row['argument'], true));