MyBB Community Forums

Full Version: inc/functions_post.php warning 1.8.36
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A warning is generated.
<error>
	<dateline>1694628867</dateline>
	<datetime>2023-09-13 18:14:27 UTC -0500</datetime>
	<script>inc/functions_post.php(804) : eval()'d code</script>
	<line>2</line>
	<type>2</type>
	<friendly_type>Warning</friendly_type>
	<message>Undefined variable $status_type</message>
	<back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/inc/functions_post.php(804) : eval()'d code:2]
#2  eval() called at [/inc/functions_post.php:804]
#3  build_postbit() called at [/showthread.php:1121]
</back_trace>
</error>

Undefined variable $status_type in eval'd code from inc/functions_post.php

add line before 787. Find
		if(is_moderator($fid, "canviewdeleted") && $postcounter != 1 && $post['visible'] == -1)
and replace with
		$status_type = '';
		if(is_moderator($fid, "canviewdeleted") && $postcounter != 1 && $post['visible'] == -1)
I have another warning in inc/functions_post.php

error>
	<dateline>1695199192</dateline>
	<script>inc/functions_post.php</script>
	<line>1034</line>
	<type>2</type>
	<friendly_type>Warning</friendly_type>
	<message>Undefined variable $thumblist</message>
	<back_trace>#0  errorHandler->error() called at [/inc/class_error.php:153]
#1  errorHandler->error_callback() called at [/inc/functions_post.php:1034]
#2  get_post_attachments() called at [/inc/functions_post.php:835]
#3  build_postbit() called at [/showthread.php:1121]
</back_trace>
</error>

I added

$thumblist="";


before line 1030

if($attachment['thumbnail'] != "SMALL" && $attachment['thumbnail'] != "" && $mybb->settings['attachthumbnails'] == "yes")
					{
						eval("\$post['thumblist'] .= \"".$templates->get("postbit_attachments_thumbnails_thumbnail")."\";");
						if($tcount == 5)
						{
							$thumblist .= "<br />";
							$tcount = 0;
						}
(2023-09-20, 08:47 AM)bv64 Wrote: [ -> ]I have another warning in inc/functions_post.php
I've already reported this one and provided a pull request: https://github.com/mybb/mybb/issues/4737
thanx StefanT, I should set me a link to this github Wink