Browse Source
Explicitely only accept closures from our dependencies in ClosureJob
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/32868/head
Côme Chilliet
4 years ago
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with
4 additions and
1 deletions
-
lib/private/Command/ClosureJob.php
|
|
|
@ -23,10 +23,13 @@ |
|
|
|
namespace OC\Command; |
|
|
|
|
|
|
|
use OC\BackgroundJob\QueuedJob; |
|
|
|
use Laravel\SerializableClosure\SerializableClosure as LaravelClosure; |
|
|
|
use Opis\Closure\SerializableClosure as OpisClosure; |
|
|
|
|
|
|
|
class ClosureJob extends QueuedJob { |
|
|
|
protected function run($serializedCallable) { |
|
|
|
$callable = unserialize($serializedCallable)->getClosure(); |
|
|
|
$callable = unserialize($serializedCallable, [LaravelClosure::class, OpisClosure::class]); |
|
|
|
$callable = $callable->getClosure(); |
|
|
|
if (is_callable($callable)) { |
|
|
|
$callable(); |
|
|
|
} else { |
|
|
|
|