Skip to content

Commit cff1f19

Browse files
author
David Monllao
committed
Merge branch 'MDL-33886-34' of git://github.com/zig-moodle/moodle into MOODLE_34_STABLE
2 parents fe5d17b + e714f3c commit cff1f19

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

backup/util/ui/backup_moodleform.class.php

+2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ public function validation($data, $files) {
122122
if (!array_key_exists('setting_root_filename', $errors)) {
123123
if (trim($data['setting_root_filename']) == '') {
124124
$errors['setting_root_filename'] = get_string('errorfilenamerequired', 'backup');
125+
} else if (strlen(trim($data['setting_root_filename'])) > 255) {
126+
$errors['setting_root_filename'] = get_string('errorfilenametoolong', 'backup');
125127
} else if (!preg_match('#\.mbz$#i', $data['setting_root_filename'])) {
126128
$errors['setting_root_filename'] = get_string('errorfilenamemustbezip', 'backup');
127129
}

lang/en/backup.php

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
$string['error_course_module_not_found'] = 'Orphan course module (id: {$a}) found. This module will not be backed up.';
141141
$string['errorcopyingbackupfile'] = "Failed to copy the backup file to the temporary folder before restoring.";
142142
$string['errorfilenamerequired'] = 'You must enter a valid filename for this backup';
143+
$string['errorfilenametoolong'] = 'The filename length you enter must be less than 255 characters';
143144
$string['errorfilenamemustbezip'] = 'The filename you enter must be a ZIP file and have the .mbz extension';
144145
$string['errorminbackup20version'] = 'This backup file has been created with one development version of Moodle backup ({$a->backup}). Minimum required is {$a->min}. Cannot be restored.';
145146
$string['errorinvalidformat'] = 'Unknown backup format';

0 commit comments

Comments
 (0)