$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;
$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' => '',
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);