diff --git a/src/Wrappers/Traits/EventTrait.php b/src/Wrappers/Traits/EventTrait.php index d236387..966e363 100644 --- a/src/Wrappers/Traits/EventTrait.php +++ b/src/Wrappers/Traits/EventTrait.php @@ -284,11 +284,13 @@ final public function setRequest() { 'env' => $this->getEnv(), 'cookies' => $this->getCookies(), ]; - + $ctxRequest = new Context\Request(); - $ctxRequest->mergeFromJsonString(json_encode($contextRequestArr)); - - $this->context->setRequest($ctxRequest); + try { + $ctxRequest->mergeFromJsonString(json_encode($contextRequestArr)); + $this->context->setRequest($ctxRequest); + }catch(\Exception $ex){ + } } /** @@ -358,6 +360,15 @@ final protected function getCookieHeader(string $cookieHeader) : string return empty($cookieMask) ? $cookieHeader : ''; } + /** + * Clean Bad Characters + * + * @param string $string + * + * @return string + * @author alikaviani + * @since 2020-04-10 14:43 + */ final protected function clean_non_chars($string) { return preg_replace('/[^A-Za-z0-9\-\;\(\)\,\ \/\.]/', '', $string); // Removes special chars. }