Skip to content

Commit 3e142d4

Browse files
committed
update
1 parent 60dcde4 commit 3e142d4

File tree

1 file changed

+10
-33
lines changed

1 file changed

+10
-33
lines changed

api.php

+10-33
Original file line numberDiff line numberDiff line change
@@ -3237,30 +3237,6 @@ public function handle(Request $request): Response
32373237
}
32383238
}
32393239

3240-
// file: src/Tqdev/PhpCrudApi/Middleware/FormMiddleware.php
3241-
3242-
class FormMiddleware extends Middleware
3243-
{
3244-
public function handle(Request $request): Response
3245-
{
3246-
$body = $request->getBody();
3247-
if (!$body) {
3248-
$body = file_get_contents('php://input');
3249-
if ($body) {
3250-
parse_str($body, $input);
3251-
foreach ($input as $key => $value) {
3252-
if (substr($key, -9) == '__is_null') {
3253-
$input[substr($key, 0, -9)] = null;
3254-
unset($input[$key]);
3255-
}
3256-
}
3257-
$request->setBody((object) $input);
3258-
}
3259-
}
3260-
return $this->next->handle($request);
3261-
}
3262-
}
3263-
32643240
// file: src/Tqdev/PhpCrudApi/Middleware/JwtAuthMiddleware.php
32653241

32663242
class JwtAuthMiddleware extends Middleware
@@ -3994,6 +3970,9 @@ public static function fromString(ReflectedTable $table, String $value): Conditi
39943970
if (count($parts) < 2) {
39953971
return null;
39963972
}
3973+
if (count($parts) < 3) {
3974+
$parts[2] = '';
3975+
}
39973976
$field = $table->getColumn($parts[0]);
39983977
$command = $parts[1];
39993978
$negate = false;
@@ -4008,15 +3987,13 @@ public static function fromString(ReflectedTable $table, String $value): Conditi
40083987
$command = substr($command, 1);
40093988
}
40103989
}
4011-
if (count($parts) == 3 || (count($parts) == 2 && in_array($command, ['ic', 'is', 'iv']))) {
4012-
if ($spatial) {
4013-
if (in_array($command, ['co', 'cr', 'di', 'eq', 'in', 'ov', 'to', 'wi', 'ic', 'is', 'iv'])) {
4014-
$condition = new SpatialCondition($field, $command, $parts[2]);
4015-
}
4016-
} else {
4017-
if (in_array($command, ['cs', 'sw', 'ew', 'eq', 'lt', 'le', 'ge', 'gt', 'bt', 'in', 'is'])) {
4018-
$condition = new ColumnCondition($field, $command, $parts[2]);
4019-
}
3990+
if ($spatial) {
3991+
if (in_array($command, ['co', 'cr', 'di', 'eq', 'in', 'ov', 'to', 'wi', 'ic', 'is', 'iv'])) {
3992+
$condition = new SpatialCondition($field, $command, $parts[2]);
3993+
}
3994+
} else {
3995+
if (in_array($command, ['cs', 'sw', 'ew', 'eq', 'lt', 'le', 'ge', 'gt', 'bt', 'in', 'is'])) {
3996+
$condition = new ColumnCondition($field, $command, $parts[2]);
40203997
}
40213998
}
40223999
if ($negate) {

0 commit comments

Comments
 (0)