From 97777daf40d1bc4688e9389d093be758cfb5ba15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Kr=C3=A4mer?= Date: Sun, 5 Mar 2017 17:00:19 +0100 Subject: [PATCH] Minor changes to the cookie code --- src/Http/Cookie/Cookie.php | 4 ++-- src/Http/Cookie/CookieCryptTrait.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Http/Cookie/Cookie.php b/src/Http/Cookie/Cookie.php index 3e28f2aba96..c9dd3d3ee38 100644 --- a/src/Http/Cookie/Cookie.php +++ b/src/Http/Cookie/Cookie.php @@ -212,9 +212,9 @@ protected function validateName($name) } /** - * Gets the raw cookie value + * Gets the cookie value * - * @return string + * @return string|array */ public function getValue() { diff --git a/src/Http/Cookie/CookieCryptTrait.php b/src/Http/Cookie/CookieCryptTrait.php index 69b8f390b34..f3acd7d70ce 100644 --- a/src/Http/Cookie/CookieCryptTrait.php +++ b/src/Http/Cookie/CookieCryptTrait.php @@ -131,6 +131,12 @@ protected function _encrypt($value) } $encrypt = $this->encryptionCipher; + if ($encrypt === false) { + throw new RuntimeException( + 'Encryption is disable, no cipher given.' + ); + } + $cipher = null; $key = $this->getEncryptionKey();