Skip to content

Instantly share code, notes, and snippets.

@mudrd8mz
Created December 3, 2011 13:51
Show Gist options
  • Save mudrd8mz/1427173 to your computer and use it in GitHub Desktop.
Save mudrd8mz/1427173 to your computer and use it in GitHub Desktop.
diff --git a/blocks/html/block_html.php b/blocks/html/block_html.php
index f030401..cd3edc8 100644
--- a/blocks/html/block_html.php
+++ b/blocks/html/block_html.php
@@ -87,9 +87,11 @@ class block_html extends block_base {
global $DB;
$config = clone($data);
- // Move embedded files into a proper filearea and adjust HTML links to match
- $config->text = file_save_draft_area_files($data->text['itemid'], $this->context->id, 'block_html', 'content', 0, array('subdirs'=>true), $data
- $config->format = $data->text['format'];
+ if (is_array($data->text)) {
+ // Move embedded files into a proper filearea and adjust HTML links to match
+ $config->text = file_save_draft_area_files($data->text['itemid'], $this->context->id, 'block_html', 'content', 0, array('subdirs'=>true), $
+ $config->format = $data->text['format'];
+ }
parent::instance_config_save($config, $nolongerused);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment