diff options
| author | Misko Hevery | 2011-03-09 21:03:11 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-03-11 14:16:52 -0800 |
| commit | 26bad2bf878e54fa78ff26518d1275a7e0b5b39c (patch) | |
| tree | dd3d7122697df9c9fc5f8955f7cb2d92e6cc909d /src | |
| parent | d304b0c3df41b3b1e67c2b9d56c02dc95194512d (diff) | |
| download | angular.js-26bad2bf878e54fa78ff26518d1275a7e0b5b39c.tar.bz2 | |
Fixed cookies which contained unescaped '=' would not show up in cookie service.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Browser.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Browser.js b/src/Browser.js index af87c47d..446944eb 100644 --- a/src/Browser.js +++ b/src/Browser.js @@ -280,7 +280,7 @@ function Browser(window, document, body, XHR, $log) { * @returns {Object} Hash of all cookies (if called without any parameter) */ self.cookies = function (name, value) { - var cookieLength, cookieArray, i, keyValue; + var cookieLength, cookieArray, cookie, i, keyValue, index; if (name) { if (value === _undefined) { @@ -307,9 +307,10 @@ function Browser(window, document, body, XHR, $log) { lastCookies = {}; for (i = 0; i < cookieArray.length; i++) { - keyValue = cookieArray[i].split("="); - if (keyValue.length === 2) { //ignore nameless cookies - lastCookies[unescape(keyValue[0])] = unescape(keyValue[1]); + cookie = cookieArray[i]; + index = cookie.indexOf('='); + if (index > 0) { //ignore nameless cookies + lastCookies[unescape(cookie.substring(0, index))] = unescape(cookie.substring(index + 1)); } } } |
