2019-09-22, 11:06 PM
Quote:Your copy of MyBB running on Ho-Lee-Fooks (https://ho-lee-fooks.com/forum) has experienced an error. Details of the error include:
---
Type: 2
File: inc/datahandlers/warnings.php (Line no. 595)
Message
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
I have received 3 of these today at approximately 11a, 2p and 3p server time. I have not seen evidence of php errors in my browser. Could this be generated by another user and system sends errors to me?
Suggestions welcome. Thanks. Meanwhile, I will go see what line 595 says.
I am answering my own question. This appears to be a coding error.
Switch statements are usually ended with break.
If or while loops are usually ended with continue which passes control to the top of the loop.
Or so suggests w3resource.
Here is the code block. I think the programmer meant continue; instead of continue 2;
I am not a programmer. Looking for feedback.
Quote:591 switch($i)
592 {
593 case 1: // Ban
594 // we'll have to resort to letting the admin/mod remove the ban manually, since there's an issue if stacked bans are in force...
595 continue 2;
596 case 2: // Revoke posting
597 $current_expiry_field = 'suspensiontime';
598 $current_inforce_field = 'suspendposting';
599 break;
600 case 3:
601 $current_expiry_field = 'moderationtime';
602 $current_inforce_field = 'moderateposts';
603 break;
604 }
Something's wrong here.
DB field shows timestamp correctly for warnings issued in April 2017.
Displaying the Warning Log in ModCP shows a number of warnings were issued today less than an hour ago. Not sure if that's server time or my local time.
Devs?
I compared theĀ inc/datahandlers/warnings.php files.
There is no difference between version 1819 and 1821 except for the line 595.
The new version says 'continue 2;'
The old version says 'continue;'
I solved the error message email by reverting to the older file.
Incorrect dates in the warning log still exists.
See attached screen shot.
[attachment=42208]