const DBCONFIGAVAILABLE = 4;
const MAINTENANCEDISABLED = 8;
+ const BACKEND_CONTENT_TYPES = ['application/jrd+json', 'text/xml',
+ 'application/rss+xml', 'application/atom+xml', 'application/activity+json'];
+
/***
* @var int The mode of this Application
*
*/
public function determineRunMode(bool $isBackend, Module $module, array $server, MobileDetect $mobileDetect)
{
- $isBackend = $isBackend ||
- $module->isBackend();
+ foreach (self::BACKEND_CONTENT_TYPES as $type) {
+ if (strpos(strtolower($server['HTTP_ACCEPT'] ?? ''), $type) !== false) {
+ $isBackend = true;
+ }
+ }
+
+ $isBackend = $isBackend || $module->isBackend();
$isMobile = $mobileDetect->isMobile();
$isTablet = $mobileDetect->isTablet();
$isAjax = strtolower($server['HTTP_X_REQUESTED_WITH'] ?? '') == 'xmlhttprequest';