From 7ba59fc9a471835fb815d966680d6ae61a304562 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 16 Feb 2015 14:48:10 +1030 Subject: [PATCH] Better check for user property in command validators --- framework/core/src/Flarum/Core/Support/CommandValidator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/core/src/Flarum/Core/Support/CommandValidator.php b/framework/core/src/Flarum/Core/Support/CommandValidator.php index ad5f7737f..523645216 100644 --- a/framework/core/src/Flarum/Core/Support/CommandValidator.php +++ b/framework/core/src/Flarum/Core/Support/CommandValidator.php @@ -17,10 +17,10 @@ class CommandValidator public function validate($command) { - if (! $command->user) { + if (empty($command->user)) { throw new InvalidArgumentException('Empty argument [user] in command ['.get_class($command).']'); } - + $validator = $this->validator->make(get_object_vars($command), $this->rules); $this->fireValidationEvent([$validator, $command]);