Skip to content

Commit

Permalink
Merge pull request #275 from robiso/334
Browse files Browse the repository at this point in the history
- Fix for null values in database

Thanks to @slavenstancic
  • Loading branch information
robiso committed Jul 26, 2022
2 parents b1fe640 + b76907e commit 4b20353
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions index.php
Expand Up @@ -7,7 +7,7 @@
*/

session_start();
define('VERSION', '3.3.3');
define('VERSION', '3.3.4');
mb_internal_encoding('UTF-8');

if (defined('PHPUNIT_TESTING') === false) {
Expand Down Expand Up @@ -1056,7 +1056,11 @@ public function get()
$object = $this->db;

foreach ($args as $key => $arg) {
$object = $object->{$arg} ?? $this->set(...array_merge($args, [new stdClass]));
if (!property_exists($object, $arg)) {
$this->set(...array_merge($args, [new stdClass]));
}

$object = $object->{$arg};
}

return $object;
Expand Down Expand Up @@ -2880,7 +2884,12 @@ private function reindexObject(stdClass $object): stdClass
*/
private function isHttpsForced(): bool
{
return $this->get('config', 'forceHttps') ?? false;
$value = $this->get('config', 'forceHttps');
if (gettype($value) === 'object' && empty(get_object_vars($value))) {
return false;
}

return $value ?? false;
}

/**
Expand All @@ -2889,6 +2898,11 @@ private function isHttpsForced(): bool
*/
private function isSaveChangesPopupEnabled(): bool
{
return $this->get('config', 'saveChangesPopup') ?? false;
$value = $this->get('config', 'saveChangesPopup');
if (gettype($value) === 'object' && empty(get_object_vars($value))) {
return false;
}

return $value ?? false;
}
}
2 changes: 1 addition & 1 deletion version
@@ -1 +1 @@
3.3.3
3.3.4

0 comments on commit 4b20353

Please sign in to comment.