mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 06:27:52 +00:00
fix: add division by zero check, return zero instead of exception
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
This is no official release!
|
||||||
|
The Release and the release notes will be generated by github actions
|
||||||
|
|||||||
@@ -2323,6 +2323,10 @@ function mp_mult_($p1, $p2): float|int
|
|||||||
*/
|
*/
|
||||||
function mp_div_($p1, $p2): float|int
|
function mp_div_($p1, $p2): float|int
|
||||||
{
|
{
|
||||||
|
if ($p2 == 0) {
|
||||||
|
Log::add("Division by zero detected in mp_div_: divisor was 0. Returning 0 as fallback.", Log::WARNING, "com_sportsmanager");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return $p1 / $p2;
|
return $p1 / $p2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function addOnLoad($function): void
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
function SportsManagerURL($weitereParameter = null, $ssl = 0): ?string
|
function SportsManagerURL($weitereParameter = "", $ssl = 0): ?string
|
||||||
{
|
{
|
||||||
$urlPath = handleFilter($weitereParameter);
|
$urlPath = handleFilter($weitereParameter);
|
||||||
$joomlaBaseUrl = Uri::getInstance()->toString([
|
$joomlaBaseUrl = Uri::getInstance()->toString([
|
||||||
|
|||||||
Reference in New Issue
Block a user