Opened 20 months ago
Closed 20 months ago
#8860 closed defect (bug) (fixed)
PHP 8.1.17 - PHP Fatal error: Uncaught TypeError: Unsupported operand types: int - string in bp-core/bp-core-functions.php:1349
Reported by: | lenasterg | Owned by: | imath |
---|---|---|---|
Milestone: | 12.0.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Core | Keywords: | has-patch |
Cc: |
Description
Hi.
I just updated to PHP 8.1.17 and I get the following Fatal error
PHP Fatal error: Uncaught TypeError: Unsupported operand types: int - string in bp-core/bp-core-functions.php:1349
I managed to solve it by replacing the line 1349
$diff = $r['newer_date'] - $r['older_date'];
with the
$diff = (int)$r['newer_date'] - (int)$r['older_date'];
Please, replace it at the next version.
Thanks again for the great work.
Bests, Lena
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Hi @lenasterg
Thanks for your report, this is probably due to a plugin using
bp_core_time_diff()
the wrong way. I've added strict checks about expected arguments to avoid this in 8860.patch.