rewrite pppr_is_local

This commit is contained in:
Remo Zaros
2026-07-01 11:17:12 +02:00
parent 2df645be97
commit bdeae51bdb

View File

@@ -162,6 +162,14 @@ function get_PPPR_data() {
}
function pppr_is_local() {
$first_char = $_COOKIE['PPPR'][0];
return $first_char === '1';
// Check if the cookie exists and is not empty
if (isset($_COOKIE['PPPR']) && !empty($_COOKIE['PPPR'])) {
// Ensure it's treated as a string before accessing the first character
$cookie_value = (string) $_COOKIE['PPPR'];
$first_char = $cookie_value[0] ?? '';
return $first_char === '1';
}
// Return false if cookie is missing or empty
return false;
}