1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-23 01:22:30 +01:00

Stop Dane from submitting invalid arrays and breaking the entire application...

This commit is contained in:
Dane Everitt 2017-10-08 23:44:27 -05:00
parent aaf96669d4
commit e2cb789b2b
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -249,6 +249,10 @@ abstract class EloquentRepository extends Repository implements RepositoryInterf
Assert::boolean($validate, 'Third argument passed to updateOrCreate must be boolean, received %s.');
Assert::boolean($force, 'Fourth argument passed to updateOrCreate must be boolean, received %s.');
foreach ($where as $item) {
Assert::true(is_scalar($item) || is_null($item), 'First argument passed to updateOrCreate should be an array of scalar or null values, received an array value of %s.');
}
$instance = $this->withColumns('id')->findWhere($where)->first();
if (! $instance) {