@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 QR code generation

Summary:
This was already attempted to get fixed in rP816865e153b4 / D26180.

The problem is not that the return value contains a float, but that $col can
be a float due to the division by $this->blocks. Cast to int does the trick
here (rounding would actually be bad in this case).

See also https://we.phorge.it/rP816865e15#5844

Test Plan:
(copied from D26180)
- 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: avivey, O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: pppery, aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

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

+2 -2
+2 -2
externals/phpqrcode/phpqrcode.php
··· 4396 4396 if($col >= $this->rsblocks[0]->dataLength) { 4397 4397 $row += $this->b1; 4398 4398 } 4399 - $ret = round(($this->rsblocks[$row]->data[$col]), 0); 4399 + $ret = $this->rsblocks[$row]->data[(int) $col]; 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; 4403 - $ret = $this->rsblocks[$row]->ecc[$col]; 4403 + $ret = $this->rsblocks[$row]->ecc[(int) $col]; 4404 4404 } else { 4405 4405 return 0; 4406 4406 }