Skip to content

Commit

Permalink
refactor: check empty string on ResponseTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 27, 2024
1 parent 6095b0a commit 2e191e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/HTTP/ResponseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ public function getCookieStore()
*/
public function hasCookie(string $name, ?string $value = null, string $prefix = ''): bool
{
$prefix = $prefix !== '' && $prefix !== '0' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC
$prefix = $prefix !== '' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC

return $this->cookieStore->has($name, $prefix, $value);
}
Expand All @@ -586,7 +586,7 @@ public function getCookie(?string $name = null, string $prefix = '')
}

try {
$prefix = $prefix !== '' && $prefix !== '0' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC
$prefix = $prefix !== '' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC

return $this->cookieStore->get($name, $prefix);
} catch (CookieException $e) {
Expand All @@ -607,7 +607,7 @@ public function deleteCookie(string $name = '', string $domain = '', string $pat
return $this;
}

$prefix = $prefix !== '' && $prefix !== '0' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC
$prefix = $prefix !== '' ? $prefix : Cookie::setDefaults()['prefix']; // to retain BC

$prefixed = $prefix . $name;
$store = $this->cookieStore;
Expand Down

0 comments on commit 2e191e8

Please sign in to comment.