diff --git a/CHANGELOG.md b/CHANGELOG.md index 96919f2b82..e73fd9947c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ HumHub Changelog - Enh #7333: Improved Yii alias handling and added ENV support - Enh #7334: New safe method to rename a database column - Enh #7336: Update GitHub workflow versions +- Enh #7339: Add `DeviceDetectorHelper::isMultiInstanceApp()` method to detect if the app is running in a multi-instance mode 1.17.0-beta.2 (November 12, 2024) --------------------------------- diff --git a/protected/humhub/helpers/DeviceDetectorHelper.php b/protected/humhub/helpers/DeviceDetectorHelper.php index 48828e8020..abfa0a7744 100644 --- a/protected/humhub/helpers/DeviceDetectorHelper.php +++ b/protected/humhub/helpers/DeviceDetectorHelper.php @@ -52,6 +52,13 @@ class DeviceDetectorHelper && Yii::$app->request->headers->get('x-humhub-app-is-android'); } + public static function isMultiInstanceApp(): bool + { + return + static::isAppRequest() + && Yii::$app->request->headers->get('x-humhub-app-is-multi-instance'); + } + public static function isMicrosoftOffice(): bool { return str_contains((string)Yii::$app->request->getUserAgent(), 'Microsoft Office');