Browse code

reviews.php: fix Uncaught TypeError in PHP 8.x with leaving a review with co-authors - seems related to the newer upstream patches

Clarissa Walker authored on 2026/11/01 11:31:45
Showing 1 changed files
... ...
@@ -224,10 +224,11 @@ else if($action == "edit" || $action == "add") {
224 224
 
225 225
 				$uidquery = dbquery("SELECT uid,title, coauthors FROM ".TABLEPREFIX."fanfiction_stories WHERE sid = '$item'");
226 226
 				list($author, $title, $coauthors) = dbrow($uidquery);
227
+				$coauthors = array();
227 228
 				if($coauthors) {
228 229
 					$coQuery = dbquery("SELECT uid FROM ".TABLEPREFIX."fanfiction_coauthors WHERE sid = '$item'");
229 230
 					while($c = dbassoc($coQuery)) {
230
-						$coauthors = $c['uid']; // was $coauthors[], crashes PHP 8.x. Check this later...
231
+						$coauthors[] = $c['uid'];
231 232
 					}
232 233
 				}
233 234
 			}