mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 01:52:02 -04:00
Update PHPStan and Safe PHP, and review codebase for further type correctness
This commit is contained in:
parent
e2e14a3551
commit
9d1b66d19e
35 changed files with 301 additions and 169 deletions
|
@ -68,6 +68,7 @@ class Template{
|
|||
public static function RedirectToLogin(bool $redirectToDestination = true, ?string $destinationUrl = null): void{
|
||||
if($redirectToDestination){
|
||||
if($destinationUrl === null){
|
||||
/** @var string $destinationUrl */
|
||||
$destinationUrl = $_SERVER['SCRIPT_URL'];
|
||||
}
|
||||
|
||||
|
@ -81,6 +82,8 @@ class Template{
|
|||
}
|
||||
|
||||
public static function IsEreaderBrowser(): bool{
|
||||
return isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], "Kobo") !== false || strpos($_SERVER['HTTP_USER_AGENT'], "Kindle") !== false);
|
||||
/** @var string $httpUserAgent */
|
||||
$httpUserAgent = $_SERVER['HTTP_USER_AGENT'] ?? '';
|
||||
return $httpUserAgent != '' && (strpos($httpUserAgent, "Kobo") !== false || strpos($httpUserAgent, "Kindle") !== false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue