From: skodak Date: Tue, 14 Jul 2009 08:25:51 +0000 (+0000) Subject: MDL-14589 fixed incorrect condition testing if files allowed when postprocessing... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7f0fedc0b5f3c6304634b51df38e9d9f616ddd06;p=moodle.git MDL-14589 fixed incorrect condition testing if files allowed when postprocessing editor element data, thanks Nicolas for reporting this --- diff --git a/lib/filelib.php b/lib/filelib.php index 1a87d626d5..036dabe67a 100644 --- a/lib/filelib.php +++ b/lib/filelib.php @@ -247,10 +247,10 @@ 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)) { - $data->{$field} = file_save_draft_area_files($editor['itemid'], $context->id, $filearea, $itemid, $options, $editor['text'], $options['forcehttps']); - } else { + if ($options['maxfiles'] == 0 or is_null($filearea) or is_null($itemid)) { $data->{$field} = $editor['text']; + } else { + $data->{$field} = file_save_draft_area_files($editor['itemid'], $context->id, $filearea, $itemid, $options, $editor['text'], $options['forcehttps']); } $data->{$field.'format'} = $editor['format'];