Skip to content

Commit

Permalink
10.5: [Code Cleanup]
Browse files Browse the repository at this point in the history
  • Loading branch information
jstanden committed Sep 6, 2024
1 parent 98c290d commit 351638f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion features/cerberusweb.core/api/dao/mail_transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static private function _getObjectsFromResult($rs) {
$object->updated_at = $row['updated_at'];

// Unserialize JSON params
if(false != (@$params = json_decode($row['params_json'], true)))
if(false !== ($params = json_decode($row['params_json'] ?: '', true)))
$object->params = $params;

$objects[$object->id] = $object;
Expand Down
6 changes: 5 additions & 1 deletion features/cerberusweb.core/api/dao/snippet.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,12 @@ public function getPrompts() : array {

foreach($prompts as $prompt_key => &$prompt) {
list($prompt_type, $prompt_name) = array_pad(explode('/', $prompt_key, 2), 2, null);

if(!is_array($prompt))
$prompt = [];

$prompt['type'] = $prompt_type;
$prompt['name'] = $prompt_name;
$prompt['name'] = $prompt_name ?: $prompt_type;

// Sanitize
if(array_key_exists('default', $prompt) && !is_scalar($prompt['default'])) {
Expand Down

0 comments on commit 351638f

Please sign in to comment.