diff options
author | icewind1991 <robin@icewind.nl> | 2014-06-27 02:24:22 +0200 |
---|---|---|
committer | icewind1991 <robin@icewind.nl> | 2014-06-27 02:24:22 +0200 |
commit | 58c03f5e8570e0e07387a2a3d7cce7fcad35ecbf (patch) | |
tree | 8337ea968e8110ef1f5cf8aa38c2228d9b97f444 | |
parent | 2daffbc44ec8c2f2c3c580cf6389e5b0b5a48506 (diff) | |
parent | f93457c41d6a75bb5614708ff385b06eabc6ffed (diff) | |
download | nextcloud-server-58c03f5e8570e0e07387a2a3d7cce7fcad35ecbf.tar.gz nextcloud-server-58c03f5e8570e0e07387a2a3d7cce7fcad35ecbf.zip |
Merge pull request #9241 from owncloud/backgroundjob-check
Check if classes/method exists before trying to call them in background jobs
-rw-r--r-- | lib/private/backgroundjob/joblist.php | 4 | ||||
-rw-r--r-- | lib/private/backgroundjob/legacy/queuedjob.php | 4 | ||||
-rw-r--r-- | lib/private/backgroundjob/legacy/regularjob.php | 4 |
3 files changed, 10 insertions, 2 deletions
diff --git a/lib/private/backgroundjob/joblist.php b/lib/private/backgroundjob/joblist.php index 6641097cf90..211d7e9abfc 100644 --- a/lib/private/backgroundjob/joblist.php +++ b/lib/private/backgroundjob/joblist.php @@ -152,6 +152,10 @@ class JobList implements IJobList { if ($class === 'OC_Cache_FileGlobalGC') { $class = '\OC\Cache\FileGlobalGC'; } + if (!class_exists($class)) { + // job from disabled app or old version of an app, no need to do anything + return null; + } $job = new $class(); $job->setId($row['id']); $job->setLastRun($row['last_run']); diff --git a/lib/private/backgroundjob/legacy/queuedjob.php b/lib/private/backgroundjob/legacy/queuedjob.php index 2bc001103b8..c5705abb467 100644 --- a/lib/private/backgroundjob/legacy/queuedjob.php +++ b/lib/private/backgroundjob/legacy/queuedjob.php @@ -13,6 +13,8 @@ class QueuedJob extends \OC\BackgroundJob\QueuedJob { $class = $argument['klass']; $method = $argument['method']; $parameters = $argument['parameters']; - call_user_func(array($class, $method), $parameters); + if (is_callable(array($class, $method))) { + call_user_func(array($class, $method), $parameters); + } } } diff --git a/lib/private/backgroundjob/legacy/regularjob.php b/lib/private/backgroundjob/legacy/regularjob.php index d4cfa348cea..eb85a30b4be 100644 --- a/lib/private/backgroundjob/legacy/regularjob.php +++ b/lib/private/backgroundjob/legacy/regularjob.php @@ -10,6 +10,8 @@ namespace OC\BackgroundJob\Legacy; class RegularJob extends \OC\BackgroundJob\Job { public function run($argument) { - call_user_func($argument); + if (is_callable($argument)) { + call_user_func($argument); + } } } |