X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Frequest%2Fclass_HttpRequest.php;h=b95bab1bbdb790dad06dc6e5ece4a94da4c847fc;hb=12a993738a1d1bea29a886e06478beb145c275e5;hp=6826d76b71dbdeea91a4774103c4c03e65341252;hpb=375d32104957e2401b7d2d5d20a48b32abc75831;p=hub.git diff --git a/inc/classes/main/request/class_HttpRequest.php b/inc/classes/main/request/class_HttpRequest.php index 6826d76b7..b95bab1bb 100644 --- a/inc/classes/main/request/class_HttpRequest.php +++ b/inc/classes/main/request/class_HttpRequest.php @@ -27,6 +27,13 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable { */ private $requestData = array(); + /** + * Wether this request is valid and can be further processed. The default is + * valid so make sure your intercepting filters sets this attribute to false + * when they need to intercept the data flow. + */ + private $requestIsValid = true; + /** * Protected constructor * @@ -37,7 +44,7 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable { parent::__construct(__CLASS__); // Set part description - $this->setObjectDescription("HTTP-Anfrage"); + $this->setObjectDescription("HTTP request"); // Create unique ID number $this->createUniqueID(); @@ -145,6 +152,34 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable { // Return the value return $headerValue; } + + /** + * Getter for request method. This getter might be useful for security filters + * + * @return $requestMethod Used request method + */ + public final function getRequestMethod () { + return $_SERVER['REQUEST_METHOD']; + } + + /** + * Sets wether the request was valid (default: true) + * + * @param $isValid Wether the request is valid + * @return void + */ + public final function requestIsValid ($isValid = true) { + $this->requestIsValid = (bool) $isValid; + } + + /** + * Returns wether this request is valid + * + * @return $requestIsValid Wether this request is valid + */ + public final function isRequestValid () { + return $this->requestIsValid; + } } // [EOF]