summaryrefslogtreecommitdiff
path: root/src/Http/Request.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-11-20 16:02:03 +0100
committermsquare <msquare@notrademark.de>2018-11-21 19:24:36 +0100
commit944c29b96429ec95ac1371cb33cc43704a60c7b1 (patch)
tree7be99e68d8c15fc7e210a4b3ccc44861a8d1de64 /src/Http/Request.php
parentfd37c9d60ea818dc9a562fa88ff5f9a50132506f (diff)
Require POST for sending forms
* Ensure that the form is submitted with a post request * Replaced several links with forms Closes #494 (Security Vulnerability)
Diffstat (limited to 'src/Http/Request.php')
-rw-r--r--src/Http/Request.php13
1 files changed, 13 insertions, 0 deletions
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
@@ -52,6 +52,19 @@ class Request extends SymfonyRequest implements ServerRequestInterface
}
/**
+ * 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
*
* @return string