X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Frequest%2Fclass_HttpRequest.php;h=a046f185c689e055a03a777f26e0cd3a566659fb;hp=b6f9b95f46c6f2cd874228c1b2afde5532df8f1c;hb=2230a2e7e09b6b47fe3d68181a28a4435c1732e6;hpb=4365745a3952764d684556852c31d0e8cba5e58e diff --git a/inc/classes/main/request/class_HttpRequest.php b/inc/classes/main/request/class_HttpRequest.php index b6f9b95f46..a046f185c6 100644 --- a/inc/classes/main/request/class_HttpRequest.php +++ b/inc/classes/main/request/class_HttpRequest.php @@ -1,10 +1,10 @@ * @version 0.0.0 - * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -43,12 +43,6 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable { // Call parent constructor parent::__construct(__CLASS__); - // Set part description - $this->setObjectDescription("HTTP request"); - - // Create unique ID number - $this->generateUniqueId(); - // Clean up a little $this->removeNumberFormaters(); $this->removeSystemArray(); @@ -86,13 +80,12 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable { * Checks wether a request element is set * @param $element Name of the request element we want to check * @return $isSet Wether the request element is set - * @throws MissingArrayElementsException Thrown if a request element is not set */ public function isRequestElementSet ($element) { // Is this element found? if (!isset($this->requestData[$element])) { - // Then throw an exception - throw new MissingArrayElementsException(array($this, 'requestData', $element), self::EXCEPTION_MISSING_ELEMENT); + // Then return false + return false; } // END - if // All clear @@ -110,13 +103,14 @@ class HttpRequest extends BaseFrameworkSystem implements Requestable { // Initialize value $value = null; - try { - if ($this->isRequestElementSet($element)) { - $value = $this->requestData[$element]; - } // END - if - } catch (MissingArrayElementsException $e) { - // Do nothing here - } + // Is the element set? + if ($this->isRequestElementSet($element)) { + // Get the bare value + $value = $this->requestData[$element]; + + // Secure it against attacks + $value = htmlentities(strip_tags($value), ENT_QUOTES); + } // END - if // Return the element's value return $value;