Browse code

browse/class.php: fix Uncaught TypeError in PHP 8 with visiting a classification type that has no classifications listed

Clarissa Walker authored on 2026/09/27 02:13:47
Showing 1 changed files
... ...
@@ -41,6 +41,7 @@ else if(isset($type_id)) {
41 41
 	$output .= "<div id='pagetitle'>".$classtypelist[$type_id]['title']."</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
+		else $clist[] = '';
44 45
 	}
45 46
 	$total = count($clist);
46 47
 	$count = 0;
... ...
@@ -60,4 +61,4 @@ else if(isset($type_id)) {
60 61
 	}
61 62
 	$output .= "</div>".($displaycolumns ? "</div>" : "")."<div class='cleaner'>&nbsp;</div></div>";
62 63
 }
63
-else $output .= _ERROR;
64 64
\ No newline at end of file
65
+else $output .= _ERROR;