This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ This project versioning adheres to [Semantic Versioning](http://semver.org/).
1818
1919### Fixed
2020- ` WebDriverExpectedCondition::presenceOfElementLocated() ` works correctly when used within ` WebDriverExpectedCondition::not() ` .
21+ - Improper behavior of Microsoft Edge when retrieving all cookies via ` getCookies() ` (it was causing fatal error when there were no cookies).
2122
2223## 1.7.1 - 2019-06-13
2324### Fixed
Original file line number Diff line number Diff line change @@ -107,6 +107,10 @@ public function getCookieNamed($name)
107107 [':name ' => $ name ]
108108 );
109109
110+ if (!is_array ($ cookieArray )) { // Microsoft Edge returns null even in W3C mode => emulate proper behavior
111+ throw new NoSuchCookieException ('no such cookie ' );
112+ }
113+
110114 return Cookie::createFromArray ($ cookieArray );
111115 }
112116
@@ -128,8 +132,11 @@ public function getCookieNamed($name)
128132 public function getCookies ()
129133 {
130134 $ cookieArrays = $ this ->executor ->execute (DriverCommand::GET_ALL_COOKIES );
131- $ cookies = [];
135+ if (!is_array ($ cookieArrays )) { // Microsoft Edge returns null if there are no cookies...
136+ return [];
137+ }
132138
139+ $ cookies = [];
133140 foreach ($ cookieArrays as $ cookieArray ) {
134141 $ cookies [] = Cookie::createFromArray ($ cookieArray );
135142 }
You can’t perform that action at this time.
0 commit comments