Browse code

browse/class.php: More PHP 8 fixes - Uncaught TypeError, Undefined array key, Trying to access array offset on null

Clarissa Walker authored on 2026/10/05 10:06:13
Showing 1 changed files
... ...
@@ -38,12 +38,12 @@ if(!empty($classid)) {
38 38
 	$searchVars['classin'] = array($classid);
39 39
 }
40 40
 else if(isset($type_id)) {
41
-	$output .= "<div id='pagetitle'>".$classtypelist[$type_id]['title']."</div>";
41
+	$output .= "<div id='pagetitle'>".($classtypelist[$type_id]['title'] ?? null)."</div>";
42 42
 	foreach($classlist as $c => $i) {
43 43
 		if($i['type'] == $type_id) $clist[] = "<a href='browse.php?type=class&amp;type_id=$type_id&amp;classid=$c'>".$i['name']."</a><br />";
44 44
 		else $clist[] = '';
45 45
 	}
46
-	$total = count($clist);
46
+	$total = is_countable($clist);
47 47
 	$count = 0;
48 48
 	$column = 1;
49 49
 	$list = floor($total / $displaycolumns);