Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 - Fix announcements errors #4684

Open
wants to merge 2 commits into
base: feature
Choose a base branch
from

Conversation

RevertIT-alt
Copy link
Contributor

  1. Fix empty title and message
  2. Fix the potentially fatal error by incorrect data type entered in the form.

Fixed errors:
1. Fatal error: Uncaught TypeError: Unsupported operand types: string + int in \admin\modules\forum\announcements.php:619
2. Change post request data to `int` so invalid year, month, and day cannot be entered by form manipulation.

if($mybb->input['endtime_type'] == 1)
{
// Set time
$endtime_checked[1] = 'checked="checked"';
$endtime_checked[2] = '';

$endday = $mybb->input['endtime_day'];
$endday = $endmonth = $mybb->get_input('endtime_day', MyBB::INPUT_INT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like $endmonth = shouldn't be there

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember now why I did that. But looks like I did it in some sort of hacky way to prevent an undefined variable or something. Or maybe it was a mistype from my side.

@Eldenroot
Copy link
Contributor

Is this still valid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants