From 01b67c4eb3fc4e8c11edf9f27ce1bc507fc4b431 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 20 Jul 2018 00:40:39 +0200 Subject: [PATCH] Little fixes (#5414) * We now store the item delivery data in a separate table * Reorganized table structure * Fix a notice when using the profiler / ensure that permissions are strings --- src/App.php | 38 ++++++++++++++++++------------------- src/Model/PermissionSet.php | 8 ++++---- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/App.php b/src/App.php index 08cf382b54..e1843e5737 100644 --- a/src/App.php +++ b/src/App.php @@ -154,25 +154,6 @@ class App $this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR); - // The order of the following calls is important to ensure proper initialization - $this->loadConfigFiles(); - - $this->loadDatabase(); - - $this->determineMode(); - - $this->determineUrlPath(); - - Config::load(); - - if ($this->mode & self::MODE_DBAVAILABLE) { - Core\Addon::loadHooks(); - - $this->loadAddonConfig(); - } - - $this->loadDefaultTimezone(); - $this->performance['start'] = microtime(true); $this->performance['database'] = 0; $this->performance['database_write'] = 0; @@ -194,6 +175,25 @@ class App $this->callstack['rendering'] = []; $this->callstack['parser'] = []; + // The order of the following calls is important to ensure proper initialization + $this->loadConfigFiles(); + + $this->loadDatabase(); + + $this->determineMode(); + + $this->determineUrlPath(); + + Config::load(); + + if ($this->mode & self::MODE_DBAVAILABLE) { + Core\Addon::loadHooks(); + + $this->loadAddonConfig(); + } + + $this->loadDefaultTimezone(); + $this->page = [ 'aside' => '', 'bottom' => '', diff --git a/src/Model/PermissionSet.php b/src/Model/PermissionSet.php index a5d5ed2b85..c31e88bf17 100644 --- a/src/Model/PermissionSet.php +++ b/src/Model/PermissionSet.php @@ -24,10 +24,10 @@ class PermissionSet extends BaseObject public static function fetchIDForPost($postarray) { $condition = ['uid' => $postarray['uid'], - 'allow_cid' => self::sortPermissions($postarray['allow_cid']), - 'allow_gid' => self::sortPermissions($postarray['allow_gid']), - 'deny_cid' => self::sortPermissions($postarray['deny_cid']), - 'deny_gid' => self::sortPermissions($postarray['deny_gid'])]; + 'allow_cid' => self::sortPermissions(defaults($postarray, 'allow_cid', '')), + 'allow_gid' => self::sortPermissions(defaults($postarray, 'allow_gid', '')), + 'deny_cid' => self::sortPermissions(defaults($postarray, 'deny_cid', '')), + 'deny_gid' => self::sortPermissions(defaults($postarray, 'deny_gid', ''))]; $set = dba::selectFirst('permissionset', ['id'], $condition);