[BrowserKit] Improves CookieJar::get
This commit is contained in:
parent
3a3f7b6532
commit
57993143a9
@ -47,13 +47,13 @@ class CookieJar
|
|||||||
foreach ($this->cookieJar as $cookieDomain => $pathCookies) {
|
foreach ($this->cookieJar as $cookieDomain => $pathCookies) {
|
||||||
if ($cookieDomain) {
|
if ($cookieDomain) {
|
||||||
$cookieDomain = '.'.ltrim($cookieDomain, '.');
|
$cookieDomain = '.'.ltrim($cookieDomain, '.');
|
||||||
if ($cookieDomain != substr('.'.$domain, -strlen($cookieDomain))) {
|
if ($cookieDomain !== substr('.'.$domain, -\strlen($cookieDomain))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($pathCookies as $cookiePath => $namedCookies) {
|
foreach ($pathCookies as $cookiePath => $namedCookies) {
|
||||||
if ($cookiePath != substr($path, 0, strlen($cookiePath))) {
|
if (0 !== strpos($path, $cookiePath)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (isset($namedCookies[$name])) {
|
if (isset($namedCookies[$name])) {
|
||||||
|
Reference in New Issue
Block a user