From 944c29b96429ec95ac1371cb33cc43704a60c7b1 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 20 Nov 2018 16:02:03 +0100 Subject: Require POST for sending forms * Ensure that the form is submitted with a post request * Replaced several links with forms Closes #494 (Security Vulnerability) --- src/Http/Request.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Http/Request.php') diff --git a/src/Http/Request.php b/src/Http/Request.php index 4729606f..0d8d28b4 100644 --- a/src/Http/Request.php +++ b/src/Http/Request.php @@ -51,6 +51,19 @@ class Request extends SymfonyRequest implements ServerRequestInterface return !is_null($value); } + /** + * Checks if the POST data exists + * + * @param string $key + * @return bool + */ + public function hasPostData($key) + { + $value = $this->postData($key); + + return !is_null($value); + } + /** * Get the requested path * -- cgit v1.2.3-54-g00ecf