From b216a820a1a3717913a610ca1bdb4229f262a14e Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 4 Jul 2011 09:48:03 +0200 Subject: [PATCH] MDL-28161 precreate htmlpurifier dir when resetting caches Includes sloppy whitespace fix. --- lib/moodlelib.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 223dcde17e9..4eca02dc646 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -1192,6 +1192,10 @@ function purge_all_caches() { // make sure cache dir is writable, throws exception if not make_upload_directory('cache'); + // hack: this script may get called after the purifier was initialised, + // but we do not want to verify repeatedly this exists in each call + make_upload_directory('cache/htmlpurifier'); + clearstatcache(); } @@ -7628,10 +7632,10 @@ function check_php_version($version='5.2.4') { } /** - * Returns whether a device/browser combination is mobile, tablet, legacy, default or the result of + * Returns whether a device/browser combination is mobile, tablet, legacy, default or the result of * an optional admin specified regular expression. If enabledevicedetection is set to no or not set * it returns default - * + * * @return string device type */ function get_device_type() {