Permalink
Browse files

Course restore - Restrict shortname to <= 15 characters, like the dat…

…abase table.

Author: Donal McMullan <donal@catalyst.net.nz>
  • Loading branch information...
1 parent 23458f0 commit cb6f407365ed82bbfa26afe6644071da7647da7f martinlanghoff committed Jul 18, 2006
Showing with 2 additions and 1 deletion.
  1. +2 −1 backup/restorelib.php
View
3 backup/restorelib.php
@@ -480,7 +480,8 @@ function restore_create_new_course($restore,&$course_header) {
$suffixshort = "";
}
$currentfullname = $fullname.$suffixfull;
- $currentshortname = $shortname.$suffixshort;
+ // Limit the size of shortname - database column accepts <= 15 chars
+ $currentshortname = substr($shortname, 0, 15 - strlen($suffixshort)).$suffixshort;
$coursefull = get_record("course","fullname",addslashes($currentfullname));
$courseshort = get_record("course","shortname",addslashes($currentshortname));
$counter++;

0 comments on commit cb6f407

Please sign in to comment.