File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -391,6 +391,19 @@ function pruneSpecialCourses($schedules, $courseGroups) {
391391 $ courseGroupsByCourseId = array ();
392392
393393 $ courseSet = array ();
394+
395+ // Check to make sure schedule wont exceed 10,000 options
396+ $ totalSchedules = 1 ;
397+ for ($ i = 1 ; $ i <= $ _POST ['courseCount ' ]; $ i ++) {
398+ if (!isset ($ _POST ["courses {$ i }Opt " ])) { continue ; }
399+ $ totalSchedules *= count ($ _POST ["courses {$ i }Opt " ]);
400+ }
401+ if ($ totalSchedules >= 10000 ){
402+ echo json_encode (array ("error " => "argument " , "msg " => "Too many schedule possibilities to generate, try to remove classes from your shopping cart.
403+ Adding classes like YearOne or classes with hundreds of sections can cause this to occur. " , "arg " => "action " ));
404+ break ;
405+ }
406+
394407 for ($ i = 1 ; $ i <= $ _POST ['courseCount ' ]; $ i ++) { // It's 1-indexed... :[
395408 // Iterate over the courses in that course slot
396409 if (!isset ($ _POST ["courses {$ i }Opt " ])) { continue ; }
You can’t perform that action at this time.
0 commit comments