1
0
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:
Curtis Farnham 2018-01-31 12:46:25 -08:00
parent 64976eb401
commit e6f837a9a8
2 changed files with 4 additions and 1 deletions

View File

@ -348,7 +348,7 @@ class SetCookie
return false;
}
return (bool) preg_match('/\.' . preg_quote($cookieDomain) . '$/', $domain);
return (bool) preg_match('/\.' . preg_quote($cookieDomain, '/') . '$/', $domain);
}
/**

View File

@ -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()