mirror of
https://github.com/humhub/humhub.git
synced 2025-04-22 16:11:55 +02:00
Fix iOS mobile app detection for iPad devices (#7295)
* Fix: iOS mobile app detection for iPad devices * Add @since 1.17 to DeviceDetectorHelper * Add PR version in CHANGELOG * Fix detection
This commit is contained in:
parent
23a3faca61
commit
359197e638
@ -10,6 +10,7 @@ HumHub Changelog
|
||||
- Enh #7291: Disable link in `TopicLabel` when contentContainer is not present
|
||||
- Enh #7293: Add Twig string extension
|
||||
- Fix #7287: Fix `Profile::getFormDefinition` to skip virtual fields
|
||||
- Fix #7295: iOS mobile app detection for iPad devices
|
||||
|
||||
1.17.0-beta.1 (October 28, 2024)
|
||||
--------------------------------
|
||||
|
@ -10,6 +10,9 @@ namespace humhub\helpers;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* @since 1.17
|
||||
*/
|
||||
class DeviceDetectorHelper
|
||||
{
|
||||
public static function isAppRequest(): bool
|
||||
@ -38,14 +41,14 @@ class DeviceDetectorHelper
|
||||
{
|
||||
return
|
||||
static::isAppRequest()
|
||||
&& str_contains((string)Yii::$app->request->getUserAgent(), 'iPhone');
|
||||
&& Yii::$app->request->headers->get('x-humhub-app-is-ios');
|
||||
}
|
||||
|
||||
public static function isAndroidApp(): bool
|
||||
{
|
||||
return
|
||||
static::isAppRequest()
|
||||
&& str_contains((string)Yii::$app->request->getUserAgent(), 'Android');
|
||||
&& Yii::$app->request->headers->get('x-humhub-app-is-android');
|
||||
}
|
||||
|
||||
public static function isMicrosoftOffice(): bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user