2023-09-23, 01:51 PM
(This post was last modified: 2023-09-23, 01:55 PM by Laird. Edited 2 times in total.
Edit Reason: Added inline code
)
This is a tentative bug report, because I might be misunderstanding or missing something.
In debugging a friend's board, which was intermittently showing a white screen, it turned out that a database error was being generated and sent to the error handler class's
That method of the error handler, however, returned immediately due to the condition on line #171 of
It seems to me that
Unless I'm mistaken or missing something, it seems that lines #170-175 could safely be deleted in their entirety, because lines #176-179 perform the same job, but without mistakenly testing true for MyBB error types: by this (performing the same job) I mean that
Lines #170-175, which seem redundant:
Lines #176-179, which seem to make them redundant:
Am I missing something here?
Unless somebody points out that I am, I'll update my Debugging white screens thread with the advice to delete those lines if the other advice in that thread's OP fails.
In debugging a friend's board, which was intermittently showing a white screen, it turned out that a database error was being generated and sent to the error handler class's
error()
method by line #609 of inc/db_mysqli.php
: $error_handler->error(MYBB_SQL, $error);
That method of the error handler, however, returned immediately due to the condition on line #171 of
inc/class_error.php
testing true, and so my friend never saw the error message, and saw only a white screen: if((error_reporting() & $type) == 0)
It seems to me that
errorHandler::error()
ought not to return in this scenario, and that the problem is that this conditional ignores custom MyBB error types: it will always test true for them, causing the method to return without displaying anything for those error types.Unless I'm mistaken or missing something, it seems that lines #170-175 could safely be deleted in their entirety, because lines #176-179 perform the same job, but without mistakenly testing true for MyBB error types: by this (performing the same job) I mean that
error_reporting()
is in the first place initialised based on $this->ignore_types
, so testing it aside from $this->ignore_types
seems to be redundant.Lines #170-175, which seem redundant:
// Error reporting turned off for this type
if((error_reporting() & $type) == 0)
{
return true;
}
Lines #176-179, which seem to make them redundant:
if(in_array($type, $this->ignore_types))
{
return true;
}
Am I missing something here?
Unless somebody points out that I am, I'll update my Debugging white screens thread with the advice to delete those lines if the other advice in that thread's OP fails.