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:
Marc Farré 2024-11-06 13:48:46 +00:00 committed by GitHub
parent 23a3faca61
commit 359197e638
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -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)
--------------------------------

View File

@ -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