• Hi,

    This morning my site was broken due to a php fatal error in main.php of this plugin.

    The line 295 does not have any protection against division by zero:

    [07-Mar-2024 07:42:06 UTC] PHP Warning: Undefined array key “HUF” in /home/***/absonic-ict.eu/wp-content/plugins/currency-exchange-for-woocommerce/main.php on line 292
    [07-Mar-2024 07:42:06 UTC] Current rate: null [07-Mar-2024 07:42:06 UTC] PHP Fatal error: Uncaught DivisionByZeroError: Division by zero in /home/***/absonic-ict.eu/wp-content/plugins/currency-exchange-for-woocommerce/main.php:295

    It is the modified code:

    $rates[$rate_name] = $rate / ( isset($current_rate) && ! is_null($current_rate) && $current_rate != 0 ? $current_rate : 1 );

    It is just a temporary solution but at least my site is running.

    Best regards,
    Estal

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Division by Zero’ is closed to new replies.