Skip to content

Commit 58d1fae

Browse files
committed
Fix calculation relying on non-strict types
1 parent 7d08e36 commit 58d1fae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Classes/OAuthClient.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,8 @@ protected function removeExpiredAuthorizations(): void
575575
*/
576576
public function shutdownObject(): void
577577
{
578-
$decimals = strlen(strrchr($this->garbageCollectionProbability, '.')) - 1;
578+
$garbageCollectionProbability = (string)$this->garbageCollectionProbability;
579+
$decimals = strlen(strrchr($garbageCollectionProbability, '.') ?: '') - 1;
579580
$factor = ($decimals > -1) ? $decimals * 10 : 1;
580581
try {
581582
if (random_int(1, 100 * $factor) <= ($this->garbageCollectionProbability * $factor)) {

0 commit comments

Comments
 (0)