Move array into constant
This commit is contained in:
parent
73a7df85f7
commit
19816e8862
1 changed files with 4 additions and 3 deletions
|
@ -38,6 +38,9 @@ class Mode
|
||||||
const DBCONFIGAVAILABLE = 4;
|
const DBCONFIGAVAILABLE = 4;
|
||||||
const MAINTENANCEDISABLED = 8;
|
const MAINTENANCEDISABLED = 8;
|
||||||
|
|
||||||
|
const BACKEND_CONTENT_TYPES = ['application/jrd+json', 'application/xrd+xml', 'text/xml',
|
||||||
|
'application/rss+xml', 'application/atom+xml', 'application/activity+json'];
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* @var int The mode of this Application
|
* @var int The mode of this Application
|
||||||
*
|
*
|
||||||
|
@ -134,9 +137,7 @@ class Mode
|
||||||
*/
|
*/
|
||||||
public function determineRunMode(bool $isBackend, Module $module, array $server, MobileDetect $mobileDetect)
|
public function determineRunMode(bool $isBackend, Module $module, array $server, MobileDetect $mobileDetect)
|
||||||
{
|
{
|
||||||
$contenttypes = ['application/jrd+json', 'application/xrd+xml', 'text/xml',
|
foreach (self::BACKEND_CONTENT_TYPES as $type) {
|
||||||
'application/rss+xml', 'application/atom+xml', 'application/activity+json'];
|
|
||||||
foreach ($contenttypes as $type) {
|
|
||||||
if (strpos(strtolower($server['HTTP_ACCEPT'] ?? ''), $type) !== false) {
|
if (strpos(strtolower($server['HTTP_ACCEPT'] ?? ''), $type) !== false) {
|
||||||
$isBackend = true;
|
$isBackend = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue