diff --git a/src/Form/Control/Upload.php b/src/Form/Control/Upload.php index 7d09e9703b..13ef930fd0 100644 --- a/src/Form/Control/Upload.php +++ b/src/Form/Control/Upload.php @@ -140,7 +140,7 @@ public function addJsAction(JsExpressionable $action): void public function onUpload(\Closure $fx): void { $this->hasUploadCb = true; - if (($_POST['fUploadAction'] ?? null) === self::UPLOAD_ACTION) { + if ($this->getApp()->tryGetRequestPostParam('fUploadAction') === self::UPLOAD_ACTION) { $this->cb->set(function () use ($fx) { $postFiles = []; for ($i = 0;; ++$i) { @@ -187,7 +187,7 @@ public function onUpload(\Closure $fx): void public function onDelete(\Closure $fx): void { $this->hasDeleteCb = true; - if (($_POST['fUploadAction'] ?? null) === self::DELETE_ACTION) { + if ($this->getApp()->tryGetRequestPostParam('fUploadAction') === self::DELETE_ACTION) { $this->cb->set(function () use ($fx) { $fileId = $_POST['fUploadId']; @@ -206,7 +206,7 @@ protected function renderView(): void parent::renderView(); if ($this->cb->canTerminate()) { - $uploadActionRaw = $_POST['fUploadAction'] ?? null; + $uploadActionRaw = $this->getApp()->tryGetRequestPostParam('fUploadAction'); if (!$this->hasUploadCb && ($uploadActionRaw === self::UPLOAD_ACTION)) { throw new Exception('Missing onUpload callback'); } elseif (!$this->hasDeleteCb && ($uploadActionRaw === self::DELETE_ACTION)) { diff --git a/src/UserAction/JsCallbackExecutor.php b/src/UserAction/JsCallbackExecutor.php index 4388e15fc6..e96953850c 100644 --- a/src/UserAction/JsCallbackExecutor.php +++ b/src/UserAction/JsCallbackExecutor.php @@ -87,7 +87,7 @@ public function executeModelAction(): void $this->set(function (Jquery $j, ...$values) { $id = $this->getApp()->uiPersistence->typecastLoadField( $this->action->getModel()->getField($this->action->getModel()->idField), - $_POST[$this->name] ?? null + $this->getApp()->tryGetRequestPostParam($this->name) ); if ($id && $this->action->appliesTo === Model\UserAction::APPLIES_TO_SINGLE_RECORD) { if ($this->action->isOwnerEntity() && $this->action->getEntity()->getId()) { diff --git a/src/View.php b/src/View.php index 14e84be443..182210e882 100644 --- a/src/View.php +++ b/src/View.php @@ -854,10 +854,10 @@ public function jsGetStoreData(): array { $data = []; $data['local'] = $this->getApp()->decodeJson( - $this->getApp()->tryGetRequestGetParam($this->name . '_local_store') ?? $_POST[$this->name . '_local_store'] ?? 'null' + $this->getApp()->tryGetRequestGetParam($this->name . '_local_store') ?? $this->getApp()->tryGetRequestPostParam($this->name . '_local_store') ?? 'null' ); $data['session'] = $this->getApp()->decodeJson( - $this->getApp()->tryGetRequestGetParam($this->name . '_session_store') ?? $_POST[$this->name . '_session_store'] ?? 'null' + $this->getApp()->tryGetRequestGetParam($this->name . '_session_store') ?? $this->getApp()->tryGetRequestPostParam($this->name . '_session_store') ?? 'null' ); return $data; diff --git a/src/VueComponent/InlineEdit.php b/src/VueComponent/InlineEdit.php index f2c9d3748a..6452ab1495 100644 --- a/src/VueComponent/InlineEdit.php +++ b/src/VueComponent/InlineEdit.php @@ -125,7 +125,7 @@ public function onChange(\Closure $fx): void if (!$this->autoSave) { $value = $this->getApp()->uiPersistence->typecastLoadField( $this->model->getField($this->fieldName), - $_POST['value'] ?? null + $this->getApp()->tryGetRequestPostParam('value') ); $this->cb->set(static function () use ($fx, $value) { return $fx($value);