Browse code

viewstory.php: Undefined variable warnings while trying to access a nonexistent chapter for an existing story better dirty fix for PHP 8 users

Clarissa Walker authored on 2026/10/26 17:47:47
Showing 1 changed files
... ...
@@ -345,12 +345,8 @@ else {
345 345
 		}
346 346
 		$printicon = "<img src='".(isset($printer) ? $printer : "images/print.gif")."' border='0' alt='"._PRINTER."'> <a href=\"viewstory.php?action=printable&amp;sid=$sid&amp;textsize=$textsize&amp;chapter=1\" target=\"_blank\">"._STORY."</a>";
347 347
 	}
348
-	$chapterauthor = '';
349
-	$chapid = '';
350
-	$inorder = '';
351
-	$valid = '';
352 348
 	// if the *CHAPTER* hasn't been validated and the viewer isn't an admin or the author throw them a warning.  
353
-	if(!$valid && !isADMIN && USERUID != $chapterauthor && !in_array($chapterauthor, $storyinfo['coauthors'])) {
349
+	if(!isset($valid) && !isADMIN && USERUID != isset($chapterauthor) && !in_array(isset($chapterauthor), isset($storyinfo['coauthors']))) {
354 350
 		$warning = accessDenied( );
355 351
 	}
356 352
 	$stories = $storyinfo;