Permalink
Browse files

Now backup names are cleaned completely, avoiding some problems

with translations and manually typed names with diacritics.
Thanks to Marian Zvalo!

Merged from MOODLE_14_STABLE
  • Loading branch information...
stronk7
stronk7 committed Dec 19, 2004
1 parent d30981d commit 99f363bf660fb42fd0fed54258881db0ae8ba3c3
Showing with 9 additions and 2 deletions.
  1. +2 −0 backup/backup_check.html
  2. +3 −2 backup/backup_execute.html
  3. +4 −0 backup/backup_scheduled.php
View
@@ -115,6 +115,8 @@
$backup_name .= userdate(time(),$backup_date_format,99,false);
//The extension
$backup_name .= ".zip";
+ //And finally, clean everything
+ $backup_name = clean_filename($backup_name);
//Add as text field
echo "<input type=\"text\" name=\"backup_name\" size=\"40\" value=\"".$backup_name."\">";
@@ -88,7 +88,8 @@
if (!isset($backup_name)) {
error ("Backup name not specified");
}
- $preferences->backup_name = $backup_name;
+ //We clean it again (to prevent diacritics entered manually)
+ $preferences->backup_name = clean_filename($backup_name);
if (!isset($backup_unique_code)) {
error ("Backup unique code not specified");
@@ -113,7 +114,7 @@
echo "<td align=\"right\"><p><b>";
echo get_string("name").":";
echo "</b></td><td>";
- echo $backup_name;
+ echo $preferences->backup_name;
echo "</td></tr>";
//Start the main tr, where all the backup progress is done
@@ -425,11 +425,15 @@ function schedule_backup_course_configure($course,$starttime = 0) {
$backup_name .= userdate(time(),$backup_date_format,99,false);
//The extension
$backup_name .= ".zip";
+ //And finally, clean everything
+ $backup_name = clean_filename($backup_name);
//Calculate the string to match the keep preference
$keep_name = $backup_word."-";
//The shortname
$keep_name .= strtolower($backup_shortname)."-";
+ //And finally, clean everything
+ $keep_name = clean_filename($keep_name);
$preferences->backup_name = $backup_name;
$preferences->keep_name = $keep_name;

0 comments on commit 99f363b

Please sign in to comment.