From 798a060b044c44cb5d80966f3176fd20d2496430 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Fri, 11 Jan 2013 11:44:34 +0800 Subject: [PATCH] MDL-32341 calendar: get_file_by_hash() expects a hash --- mod/book/tool/importhtml/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/book/tool/importhtml/locallib.php b/mod/book/tool/importhtml/locallib.php index c37976f5523..7b64a210d30 100644 --- a/mod/book/tool/importhtml/locallib.php +++ b/mod/book/tool/importhtml/locallib.php @@ -54,7 +54,7 @@ function toolbook_importhtml_import_chapters($package, $type, $book, $context, $ } if ($type == 0) { $chapterfile = reset($chapterfiles); - if ($file = $fs->get_file_by_hash("$context->id/mod_book/importhtmltemp/0/$chapterfile->pathname")) { + if ($file = $fs->get_file_by_hash(sha1("$context->id/mod_book/importhtmltemp/0/$chapterfile->pathname"))) { $htmlcontent = toolbook_importhtml_fix_encoding($file->get_content()); $htmlchapters = toolbook_importhtml_parse_headings(toolbook_importhtml_parse_body($htmlcontent)); // TODO: process h1 as main chapter and h2 as subchapters -- 2.43.0