]> git.mjollnir.org Git - moodle.git/commitdiff
Course restore - Restrict shortname to <= 15 characters, like the database table.
authormartinlanghoff <martinlanghoff>
Tue, 18 Jul 2006 03:35:02 +0000 (03:35 +0000)
committermartinlanghoff <martinlanghoff>
Tue, 18 Jul 2006 03:35:02 +0000 (03:35 +0000)
Author: Donal McMullan <donal@catalyst.net.nz>

backup/restorelib.php

index ff015ab75cfd8e47611041d28c85fe51aa7eb9e0..d62a0003c06cadfb427fa0e72160d7d2c509b6c8 100644 (file)
                 $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++;