Homestyx hydra
Diffusion hydra c2856b479fbd

Fix PHP 8.1 "implicit conversion from float to int" exception on certain avatar…

Description

Fix PHP 8.1 "implicit conversion from float to int" exception on certain avatar colors which blocks rendering user pages

Summary:
Since PHP 8.1, conversion from float to integer should be explicit.

https://wiki.php.net/rfc/implicit-float-int-deprecate

According to phlog, the alpha channel value of the automatically created user
avatar image for a new user account sometimes is a float.

Thus always round() the alpha channel value to be an integer.

Closes T15375

Test Plan: Applied this change, created five user accounts via http://phorge.localhost/people/new/standard/ , and each resulting alpha value in PhabricatorFilesComposeAvatarBuiltinFile.php was an integer according to phlog (see corresponding Maniphest task). Rendering of each new user page always succeeded.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15375

Differential Revision: https://we.phorge.it/D25209

Details

Provenance
Andre KlapperAuthored on May 12 2023, 5:57 AM
sirocylPushed on Oct 16 2024, 5:49 AM
Parents
R1:4d9719539773: Fix PHP 8.1 "strlen(null)" exception when trying to add empty user email address
Branches
Unknown
Tags
Unknown

Event Timeline