Skip to content

Commit ae00971

Browse files
committed
Scrutinizer: set $domain to string
1 parent bea620b commit ae00971

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

htdocs/include/xoopssetcookie.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function xoops_setcookie(
3434
string $name,
3535
?string $value = '',
3636
int $expire = 0,
37-
$path = '/',
38-
$domain = '',
37+
?string $path = '/',
38+
?string $domain = '',
3939
?bool $secure = null,
4040
bool $httponly = true,
4141
string $samesite = 'Lax'
@@ -50,6 +50,9 @@ function xoops_setcookie(
5050
if (!is_string($host)) {
5151
$host = ''; // Fallback for invalid XOOPS_URL
5252
}
53+
if (!is_string($domain)) {
54+
$domain = ''; // Fallback for invalid domain
55+
}
5356

5457
// Validate the domain BEFORE using it.
5558
if (class_exists('\Xoops\RegDom\RegisteredDomain')) {

0 commit comments

Comments
 (0)