Fix #4700: Deep Links from Microsoft Office Documents (#4702)

This commit is contained in:
Lucas Bartholemy 2020-12-30 16:08:12 +01:00 committed by GitHub
parent b253ed069f
commit 041057e037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View File

@ -5,6 +5,7 @@ HumHub Changelog
-------------------------
- Fix #4668: table-responsive tables do not overflow due to default word break style
- Fix #4679: Richtext extension scan does not include full title if title contains a `)`
- Fix #4700: Deep Links from Microsoft Office Documents
- Fix #4714: Use HTTPS protocol for default OEmbed endpoint URLs
- Fix #4727: Nav tabs with data-toggle are styled in link color
- Fix #4649: Success message rendered although password validation failed

View File

@ -24,7 +24,7 @@ if (!defined('PKCS7_DETACHED')) {
$config = [
'name' => 'HumHub',
'version' => '1.7.1',
'version' => '1.7.2',
'basePath' => dirname(__DIR__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR,
'bootstrap' => ['log', 'humhub\components\bootstrap\ModuleAutoLoader', 'queue', 'humhub\modules\ui\view\bootstrap\ThemeLoader'],
'sourceLanguage' => 'en',

View File

@ -222,4 +222,19 @@ class User extends \yii\web\User
parent::switchIdentity($identity, $duration);
}
/**
* @inheritdoc
*/
public function loginRequired($checkAjax = true, $checkAcceptHeader = true)
{
// Fix 4700: Handle Microsoft Office Probe Requests
if (strpos(Yii::$app->request->getUserAgent(), 'Microsoft Office') !== false) {
Yii::$app->response->setStatusCode(200);
Yii::$app->response->data = Yii::$app->controller->htmlRedirect(Yii::$app->request->getAbsoluteUrl());
return Yii::$app->getResponse();
}
return parent::loginRequired($checkAjax, $checkAcceptHeader);
}
}