From b91bd3177ada0e770ae12c8723cfa709f955855f Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Wed, 15 Mar 2017 19:17:31 +0100 Subject: [PATCH] cleanup construct --- api.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/api.php b/api.php index d170ebd..38052a7 100644 --- a/api.php +++ b/api.php @@ -1874,16 +1874,12 @@ class PHP_CRUD_API { if ($column_authorizer) $this->applyColumnAuthorizer($column_authorizer,$action,$database,$fields); // input - $multi = strpos($key[0],',')!==false; - $inputs = array(); - $contexts = array(); - if (strlen($post)) { - $multi = $post[0]=='['; - $contexts = $this->retrieveInputs($post); - } + $multi = (strpos($key[0],',')!==false) || (strlen($post)?($post[0]=='['):false); + $contexts = $this->retrieveInputs($post); if ($before) { $this->applyBeforeHandler($action,$database,$tables[0],$key[0],$before,$contexts); } + $inputs = array(); foreach ($contexts as $context) { $input = $this->filterInputByFields($context,$fields[$tables[0]]);