mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Fix warning in PHP 8.0 if user-agent header is missing
This commit is contained in:
parent
8e56fe5912
commit
e1f1de8e49
2 changed files with 2 additions and 2 deletions
|
|
@ -46,7 +46,7 @@ class Mobile
|
|||
// Try to detect from URL arguments and cookies, and finally fall back to user-agent detection.
|
||||
$m = Context::get('m');
|
||||
$cookie = isset($_COOKIE['rx_uatype']) ? $_COOKIE['rx_uatype'] : null;
|
||||
$uahash = base64_encode_urlsafe(md5($_SERVER['HTTP_USER_AGENT'], true));
|
||||
$uahash = base64_encode_urlsafe(md5($_SERVER['HTTP_USER_AGENT'] ?? '', true));
|
||||
if (strncmp($cookie, $uahash . ':', strlen($uahash) + 1) !== 0)
|
||||
{
|
||||
$cookie = null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue