@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix PHP 8.1 "implicit conversion from float to int" exception at QR Code creation for Multi-Factor Auth

Summary:
Since PHP 8.1, conversion from float to integer should be explicit:
https://wiki.php.net/rfc/implicit-float-int-deprecate

Always `round()` the value to be an integer.

Closes T16171

Test Plan:
* Go a bunch of times to http://phorge.localhost/settings/panel/multifactor/ and click through until a QR Code is being displayed. (I guess. As the issue does not always happen.)
* Scan QR Code and confirm setup by entering TOTP Code; seems to still work.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16171

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

+1 -1
+1 -1
externals/phpqrcode/phpqrcode.php
··· 4396 4396 if($col >= $this->rsblocks[0]->dataLength) { 4397 4397 $row += $this->b1; 4398 4398 } 4399 - $ret = $this->rsblocks[$row]->data[$col]; 4399 + $ret = round(($this->rsblocks[$row]->data[$col]), 0); 4400 4400 } else if($this->count < $this->dataLength + $this->eccLength) { 4401 4401 $row = ($this->count - $this->dataLength) % $this->blocks; 4402 4402 $col = ($this->count - $this->dataLength) / $this->blocks;