mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-23 01:23:39 +01:00
Error with malformed domain that contains a "/"
This commit is contained in:
parent
64976eb401
commit
e6f837a9a8
@ -348,7 +348,7 @@ class SetCookie
|
||||
return false;
|
||||
}
|
||||
|
||||
return (bool) preg_match('/\.' . preg_quote($cookieDomain) . '$/', $domain);
|
||||
return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -115,6 +115,9 @@ class SetCookieTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$cookie->setDomain('.local');
|
||||
$this->assertTrue($cookie->matchesDomain('example.local'));
|
||||
|
||||
$cookie->setDomain('example.com/'); // malformed domain
|
||||
$this->assertFalse($cookie->matchesDomain('example.com'));
|
||||
}
|
||||
|
||||
public function pathMatchProvider()
|
||||
|
Loading…
x
Reference in New Issue
Block a user