From: martinlanghoff Date: Tue, 18 Jul 2006 03:35:02 +0000 (+0000) Subject: Course restore - Restrict shortname to <= 15 characters, like the database table. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cb6f407365ed82bbfa26afe6644071da7647da7f;p=moodle.git Course restore - Restrict shortname to <= 15 characters, like the database table. Author: Donal McMullan --- diff --git a/backup/restorelib.php b/backup/restorelib.php index ff015ab75c..d62a0003c0 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -480,7 +480,8 @@ $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++;