• Resolved railmedia

    (@railmedia)


    Hi there,

    I found two problems in your plugin on Cloudways (DigitalOcean) hosting on PHP 8.3 + nginx.

    Both issues are in the same file: /src/PriceManager.php

    #1 – line 83 – original code:

    $productPrice = round( $productPrice, $roundPrecision );

    revised code:

    $productPrice = $productPrice && is_numeric( $productPrice ) ? round( $productPrice, $roundPrecision ) : $productPrice;

    Problem is that the value of the $productPrice variable is string instead of int.

    #2 – line 194 – original code:

    return 100 * ($originalPrice - $currentPrice) / $originalPrice;

    revised code:

    return 100 * (floatval($originalPrice) - floatval($currentPrice)) / $originalPrice;

    same problem: $originalPrice and $currentPrice are string.

    Best regards,
    Adrian

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘PHP 8.3+ fatal errors’ is closed to new replies.