]> git.mxchange.org Git - friendica.git/blobdiff - src/App.php
Merge pull request #5626 from annando/notices-oh-yeah
[friendica.git] / src / App.php
index 66bec51de7379f7a12df7a6a550d9f357f46cac2..d02ea73ca46de28dd984ef69803b36d22a19e35e 100644 (file)
@@ -11,7 +11,6 @@ use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
-use Friendica\Database\DBM;
 
 require_once 'boot.php';
 require_once 'include/dba.php';
@@ -496,7 +495,7 @@ class App
 
                $this->mode |= App::MODE_DBAVAILABLE;
 
-               if (DBA::fetch_first("SHOW TABLES LIKE 'config'") === false) {
+               if (DBA::fetchFirst("SHOW TABLES LIKE 'config'") === false) {
                        return;
                }
 
@@ -1032,7 +1031,7 @@ class App
                        }
                }
 
-               $processlist = DBM::processlist();
+               $processlist = DBA::processlist();
                if ($processlist['list'] != '') {
                        logger('Processcheck: Processes: ' . $processlist['amount'] . ' - Processlist: ' . $processlist['list'], LOGGER_DEBUG);
 
@@ -1128,7 +1127,7 @@ class App
                        return;
                }
 
-               $cmdline = $this->getConfigValue('config', 'php_path', 'php') . $command;
+               $cmdline = $this->getConfigValue('config', 'php_path', 'php') . ' ' . escapeshellarg($command);
 
                foreach ($args as $key => $value) {
                        if (!is_null($value) && is_bool($value) && !$value) {
@@ -1141,8 +1140,6 @@ class App
                        }
                }
 
-               $cmdline = escapeshellarg($cmdline);
-
                if ($this->min_memory_reached()) {
                        return;
                }
@@ -1310,11 +1307,11 @@ class App
                // Only arrays are serialized in database, so we have to unserialize sparingly
                $value = is_string($v) && preg_match("|^a:[0-9]+:{.*}$|s", $v) ? unserialize($v) : $v;
 
-               if (!isset($this->config[$uid])) {
+               if (!isset($this->config[$uid]) || !is_array($this->config[$uid])) {
                        $this->config[$uid] = [];
                }
 
-               if (!isset($this->config[$uid][$cat])) {
+               if (!isset($this->config[$uid][$cat]) || !is_array($this->config[$uid][$cat])) {
                        $this->config[$uid][$cat] = [];
                }
 
@@ -1397,21 +1394,17 @@ class App
                        // Allow folks to override user themes and always use their own on their own site.
                        // This works only if the user is on the same server
                        $user = DBA::selectFirst('user', ['theme'], ['uid' => $this->profile_uid]);
-                       if (DBM::is_result($user) && !PConfig::get(local_user(), 'system', 'always_my_theme')) {
+                       if (DBA::isResult($user) && !PConfig::get(local_user(), 'system', 'always_my_theme')) {
                                $page_theme = $user['theme'];
                        }
                }
 
-               if (!empty($_SESSION)) {
-                       $user_theme = defaults($_SESSION, 'theme', $system_theme);
-               } else {
-                       $user_theme = $system_theme;
-               }
+               $user_theme = Core\Session::get('theme', $system_theme);
 
                // Specific mobile theme override
-               if (($this->is_mobile || $this->is_tablet) && defaults($_SESSION, 'show-mobile', true)) {
+               if (($this->is_mobile || $this->is_tablet) && Core\Session::get('show-mobile', true)) {
                        $system_mobile_theme = Config::get('system', 'mobile-theme');
-                       $user_mobile_theme = defaults($_SESSION, 'mobile-theme', $system_mobile_theme);
+                       $user_mobile_theme = Core\Session::get('mobile-theme', $system_mobile_theme);
 
                        // --- means same mobile theme as desktop
                        if (!empty($user_mobile_theme) && $user_mobile_theme !== '---') {