Skip to content

Commit

Permalink
Add 'document' as content type in case if it's defaulted due to plugi…
Browse files Browse the repository at this point in the history
…n error

is_scalar is not enough validation as it not checks for empty value
  • Loading branch information
elcreator authored Sep 26, 2023
1 parent 1e472b3 commit bda3ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion manager/actions/mutate_content.dynamic.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
}
}

$content['type'] = get_by_key($content, 'type', $defaultContentType, 'is_scalar');
$content['type'] = get_by_key($content, 'type', $defaultContentType, 'is_scalar') ?: $defaultContentType;

if(isset ($_POST['which_editor'])) {
$modx->setConfig('which_editor', get_by_key($_POST, 'which_editor', '', 'is_scalar'));
Expand Down

0 comments on commit bda3ee8

Please sign in to comment.