Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f19788d

Browse filesBrowse files
committed
ignore invalid cookies expires date format
1 parent f7ba71d commit f19788d
Copy full SHA for f19788d

File tree

2 files changed

+4
-5
lines changed
Filter options

2 files changed

+4
-5
lines changed

‎src/Symfony/Component/BrowserKit/Cookie.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Cookie.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ private static function parseDate($dateValue)
213213
if (false !== $date = date_create($dateValue, new \DateTimeZone('GMT'))) {
214214
return $date->format('U');
215215
}
216-
217-
throw new \InvalidArgumentException(sprintf('Could not parse date "%s".', $dateValue));
218216
}
219217

220218
/**

‎src/Symfony/Component/BrowserKit/Tests/CookieTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/BrowserKit/Tests/CookieTest.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ public function testFromStringThrowsAnExceptionIfCookieIsNotValid()
8888
Cookie::fromString('foo');
8989
}
9090

91-
public function testFromStringThrowsAnExceptionIfCookieDateIsNotValid()
91+
public function testFromStringIgnoresInvalidExpiresDate()
9292
{
93-
$this->setExpectedException('InvalidArgumentException');
94-
Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');
93+
$cookie = Cookie::fromString('foo=bar; expires=Flursday July 31st 2020, 08:49:37 GMT');
94+
95+
$this->assertFalse($cookie->isExpired());
9596
}
9697

9798
public function testFromStringThrowsAnExceptionIfUrlIsNotValid()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.