Fix undefined $_SERVER['SERVER_SOFTWARE'] (#5021)

This commit is contained in:
Yuriy Bakhtin 2021-04-19 11:28:18 +03:00 committed by GitHub
parent f5679dc944
commit 4e2e9fe470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -14,6 +14,7 @@ HumHub Changelog
- Fix #4989: Translate profile field title in admin list
- Fix #5002: Fix loading of fixture spaces on tests
- Fix #5018: Activity stream problems with many user accounts
- Fix #5013: XSendFile broken when no SERVER_NAME header provided
1.8.1 (March 12, 2021)

View File

@ -21,7 +21,7 @@ class Response extends \yii\web\Response
*/
public function xSendFile($filePath, $attachmentName = null, $options = [])
{
if (strpos($_SERVER['SERVER_SOFTWARE'], 'nginx') === 0) {
if (isset($_SERVER['SERVER_SOFTWARE']) && stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') === 0) {
// set nginx specific X-Sendfile header name
$options['xHeader'] = 'X-Accel-Redirect';
// make path relative to docroot