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

Avoid php 8 fatal error when trying to format an empty date string #817

Merged
merged 1 commit into from
Nov 15, 2021

Conversation

bramley
Copy link
Contributor

@bramley bramley commented Oct 24, 2021

Description

The view admin page gives a fatal error when displaying an admin whose "password changed" date is empty. The error happens in the formatDate() function.

[24-Oct-2021 11:08:19 Europe/London]
PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string * int in /home/dcameron/public_html/lists/admin/connect.php:1806

Rather than try to ensure that all callers of that function do not pass an empty date field, it is simpler just to return an empty string, which is what the formatDateTime() does already.

Related Issue

Screenshots (if appropriate):

@michield
Copy link
Member

michield commented Nov 2, 2021

haven't tested, but looks fine.

@marianaballa marianaballa merged commit b10c45b into phpList:master Nov 15, 2021
@bramley bramley deleted the format_date_php_8 branch December 8, 2021 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants