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 various datahandler event.php
and calendar.php
errors
#4681
base: feature
Are you sure you want to change the base?
Conversation
`trim()` allow the blank description to be added with newlines and whitespaces. Replaced with `trim_blank_chrs()` to fix it.
`trim()` allow the blank description to be added with whitespaces. Replaced with `trim_blank_chrs()` to fix it.
This will fix datahandler `event.php` when updating the calendar event. Line `580` and line 586` are throwing errors and line `591` is redundant because errors are already thrown before we come to set a default value. Reference: https://github.com/mybb/mybb/blob/44be739f817fcc4b04afcbb91fc6d91b59815bba/inc/datahandlers/event.php#L580-L591
This will prevent users from adding an invalid year and invalidate timezone. The following example will throw an undefined error for the `timezone` array key... ```html <select name="single_year"> <option value="invalid_text">2023</option> </select> ```
} | ||
else | ||
{ | ||
$this->event_update_data['endtime'] = 0; | ||
$this->event_update_data['usingtime'] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it supposed to not be set anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, L580
and L586
are throwing errors, and L591
is redundant because errors are already thrown before we come to set a default value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it may no longer be set/corrected when neither starttime
nor endtime
are set. It may be better to leave it to preserve the intended logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submitted a correction, this now should cover all the instances of endtime/usingtime
@dvz is this finished? |
There could be more issues, but those are current ones that I manage to find and fix.