We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd1e93b commit 6db0ddfCopy full SHA for 6db0ddf
1 file changed
system/Security/Security.php
@@ -221,7 +221,17 @@ public function CSRFVerify(RequestInterface $request)
221
}
222
223
// We kill this since we're done and we don't want to pollute the _POST array
224
- unset($_POST[$this->CSRFTokenName]);
+ if (isset($_POST[$this->CSRFTokenName]))
225
+ {
226
+ unset($_POST[$this->CSRFTokenName]);
227
+ $request->setGlobal('post', $_POST);
228
+ }
229
+ // We kill this since we're done and we don't want to pollute the JSON data
230
+ elseif (isset($json->{$this->CSRFTokenName}))
231
232
+ unset($json->{$this->CSRFTokenName});
233
+ $request->setBody(json_encode($json));
234
235
236
// Regenerate on every submission?
237
if ($this->CSRFRegenerate)
0 commit comments