]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Mode.php
Merge pull request #9342 from annando/fatal
[friendica.git] / src / App / Mode.php
index 79d6d87ffa5b38de04e0bc1ab44bb5f4d7e7dde9..e19de8f07f4feaba6555f4f6b9394ee37ef9b7f8 100644 (file)
@@ -38,6 +38,9 @@ class Mode
        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
         *
@@ -134,9 +137,7 @@ class Mode
         */
        public function determineRunMode(bool $isBackend, Module $module, array $server, MobileDetect $mobileDetect)
        {
-               $contenttypes = ['application/jrd+json', 'application/xrd+xml', 'text/xml',
-                       'application/rss+xml', 'application/atom+xml', 'application/activity+json'];
-               foreach ($contenttypes as $type) {
+               foreach (self::BACKEND_CONTENT_TYPES as $type) {
                        if (strpos(strtolower($server['HTTP_ACCEPT'] ?? ''), $type) !== false) {
                                $isBackend = true;
                        }