Fix bots without user agents causing the is mobile stuff to produce errors

This commit is contained in:
Kevin MacMartin 2023-08-01 15:24:03 -04:00
parent a7bd81e37b
commit 5138f7499c

View file

@ -2,7 +2,7 @@
<html lang="{{ Language::getSessionLanguage() }}">
@php
$page_title = (isset($title) ? $title . ' - ' : '') . env('APP_NAME');
$device_mobile = preg_match('/Mobi/', Request::header('User-Agent')) || preg_match('/iP(hone|ad|od);/', Request::header('User-Agent'));
$device_mobile = !is_null(Request::header('User-Agent')) && (preg_match('/Mobi/', Request::header('User-Agent')) || preg_match('/iP(hone|ad|od);/', Request::header('User-Agent')));
@endphp
<head>