Skip to content

Commit

Permalink
MDL-14589 Check input better, preventing notices when using an editor…
Browse files Browse the repository at this point in the history
… without draftfiles
  • Loading branch information
moodler committed May 1, 2010
1 parent 601aad3 commit 9057a84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/filelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ function file_postupdate_standard_editor($data, $field, array $options, $context

$editor = $data->{$field.'_editor'};

if ($options['maxfiles'] == 0 or is_null($filearea) or is_null($itemid)) {
if ($options['maxfiles'] == 0 or is_null($filearea) or is_null($itemid) or empty($editor['itemid'])) {
$data->{$field} = $editor['text'];
} else {
$data->{$field} = file_save_draft_area_files($editor['itemid'], $context->id, $filearea, $itemid, $options, $editor['text'], $options['forcehttps']);
Expand Down

0 comments on commit 9057a84

Please sign in to comment.