From fbddcfb0e897bfa06c8996423f11fabb6fede607 Mon Sep 17 00:00:00 2001 From: urameshibr Date: Tue, 5 Apr 2016 20:38:48 -0300 Subject: [PATCH 1/3] Enabling array on method has() --- src/Illuminate/Session/Store.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Session/Store.php b/src/Illuminate/Session/Store.php index 34197132595..8eb8ff8acc0 100755 --- a/src/Illuminate/Session/Store.php +++ b/src/Illuminate/Session/Store.php @@ -308,9 +308,17 @@ public function ageFlashData() /** * {@inheritdoc} */ - public function has($name) + public function has($key) { - return ! is_null($this->get($name)); + $keys = is_array($key) ? $key : func_get_args(); + + foreach ($keys as $value) { + if (!$this->get($value)) { + return false; + } + } + + return true; } /** From 3ddcc5389df4b64646895fa5a25d97867429da42 Mon Sep 17 00:00:00 2001 From: urameshibr Date: Tue, 5 Apr 2016 20:59:19 -0300 Subject: [PATCH 2/3] Enabling array on method has() [Laravel 5.2] --- src/Illuminate/Session/Store.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Session/Store.php b/src/Illuminate/Session/Store.php index 8eb8ff8acc0..076eb1ec7b0 100755 --- a/src/Illuminate/Session/Store.php +++ b/src/Illuminate/Session/Store.php @@ -308,12 +308,12 @@ public function ageFlashData() /** * {@inheritdoc} */ - public function has($key) + public function has($name) { - $keys = is_array($key) ? $key : func_get_args(); + $keys = is_array($name) ? $name : func_get_args(); foreach ($keys as $value) { - if (!$this->get($value)) { + if (! $this->get($value)) { return false; } } From 76f69142776546d16c86a0793bcd787395a97d4b Mon Sep 17 00:00:00 2001 From: urameshibr Date: Wed, 6 Apr 2016 00:46:06 -0300 Subject: [PATCH 3/3] Update Store.php Fix return behavior --- src/Illuminate/Session/Store.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Session/Store.php b/src/Illuminate/Session/Store.php index 076eb1ec7b0..6b7898f5139 100755 --- a/src/Illuminate/Session/Store.php +++ b/src/Illuminate/Session/Store.php @@ -313,7 +313,7 @@ public function has($name) $keys = is_array($name) ? $name : func_get_args(); foreach ($keys as $value) { - if (! $this->get($value)) { + if (is_null($this->get($value))) { return false; } }