MDL-33531 backup Added format_string to course shortname
authorDavid Monllao <davidm@moodle.com>
Mon, 16 Jul 2012 02:20:20 +0000 (10:20 +0800)
committerDavid Monllao <davidm@moodle.com>
Fri, 10 Aug 2012 00:45:26 +0000 (08:45 +0800)
backup/util/helper/backup_cron_helper.class.php

index a584b44..68e9298 100644 (file)
@@ -512,7 +512,8 @@ abstract class backup_cron_automated_helper {
 
             // MDL-33531: use different filenames depending on backup_shortname option
             if ( !empty($config->backup_shortname) ) {
-                $courseref = $course->shortname;
+                $context = get_context_instance(CONTEXT_COURSE, $course->id);
+                $courseref = format_string($course->shortname, true, array('context' => $context));
                 $courseref = str_replace(' ', '_', $courseref);
                 $courseref = textlib::strtolower(trim(clean_filename($courseref), '_'));
             } else {