MyBB Community Forums

Full Version: More PHP8 warnings from production server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My forum members can generate these better than I, since they are traversing the forum more thoroughly than I. Big Grin

forum/showthread.php, line 268, undefined $lastread
forum/showthread.php, line 257, undefined $cutoff
Note: reported similar with $lastread in other places. Testing with isset() several times can be solved once by initializing.
add line 206
$lastread = $cutoff = 0;

forum/usercp.php, line 2468, undefined $smilieinserter in eval'd code line 23
add line 2415
$smilieinserter = '';

forum/member.php, line 2911, array access on value of type null
change line 2911 from
		if($last_email['mid'])
to
		if(isset($last_email['mid']))
forum/member.php, line 3084, array access on value of type null
change line 3084 from
		if($last_email['mid'])
to
		if(isset($last_email['mid']))

forum/editpost.php, line 984, undefined $preview in eval'd code line 10
add line 605
	$preview = '';
forum/editpost.php, line 619, undefined key 'visible'
change line 619 from
	if($post['visible'] != -1 && (($thread['firstpost'] == $pid && (is_moderator($fid, "candeletethreads") || $forumpermissions['candeletethreads'] == 1 && $mybb->user['uid'] == $post['uid'])) || ($thread['firstpost'] != $pid && (is_moderator($fid, "candeleteposts") || $forumpermissions['candeleteposts'] == 1 && $mybb->user['uid'] == $post['uid']))))
to
	if(isset($post['visible']) && $post['visible'] != -1 && (($thread['firstpost'] == $pid && (is_moderator($fid, "candeletethreads") || $forumpermissions['candeletethreads'] == 1 && $mybb->user['uid'] == $post['uid'])) || ($thread['firstpost'] != $pid && (is_moderator($fid, "candeleteposts") || $forumpermissions['candeleteposts'] == 1 && $mybb->user['uid'] == $post['uid']))))
inc/datahandlers/post.php, line 518, undefined key 'fid'
change line 518 from
		if(!$post['fid'])
to
		if(empty['fid'])

forum/printthread.php, line 117, undefined property MyLanguage::$archive_pages in eval'd code line 2
add line 23
$lang->load("archive");

forum/reputation.php, line 517, undefined $delete_button in eval'd code line 2
add line 439
$delete_button = '';

inc/functions_forumlist.php, line 490, undefined key 'linkto'
change line 490 from
	if($forum['linkto'] != '')
to if(isset($forum['linkto']) && $forum['linkto'] != '')[/code]
or maybe !empty($forum['linkto'])

forum/misc.php, line 728, access array on value type null while clicking link in modal whoposted.
move line 728
	$poster['posts'] = my_number_format($poster['posts']);
to new position after line 723 so 3 lines starting 723 are
		$numposts += $poster['posts'];
		$poster['posts'] = my_number_format($poster['posts']);
		eval("\$whoposted .= \"".$templates->get("misc_whoposted_poster")."\";");
Thanks! I want to add one too: https://github.com/mybb/mybb/issues/4656