]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11023 silence warnings in PHP 4.x - the last param was added in PHP 5.0.2; merged...
authorskodak <skodak>
Wed, 29 Aug 2007 20:20:10 +0000 (20:20 +0000)
committerskodak <skodak>
Wed, 29 Aug 2007 20:20:10 +0000 (20:20 +0000)
lib/datalib.php

index 73bc9aa8e24f78d927d635899fecf0bc43e129f4..0b2004c3c83aabb3ea3d79608cf2201bb7a601e6 100644 (file)
@@ -619,7 +619,8 @@ function get_my_courses($userid, $sort=NULL, $fields=NULL, $doanything=false,$li
     if (!empty($USER->id) && ($USER->id == $userid) && $usingdefaults) {
         if (!empty($USER->mycourses[$doanything])) {
             if ($limit && $limit < count($USER->mycourses[$doanything])) {
-                return array_slice($USER->mycourses[$doanything], 0, $limit, true);
+                //silence warnings in PHP 4.x - the last param was added in PHP 5.0.2
+                return @array_slice($USER->mycourses[$doanything], 0, $limit, true);
             } else {
                 return $USER->mycourses[$doanything];
             }