asdsad
This commit is contained in:
@@ -341,8 +341,8 @@ final class HomePage
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$from = strtoupper(trim($from)) ?: $this->defaultReportCurrency;
|
$from = $this->normalizeCurrency($from, $this->defaultReportCurrency);
|
||||||
$to = strtoupper(trim($to)) ?: $this->defaultReportCurrency;
|
$to = $this->normalizeCurrency($to, $this->defaultReportCurrency);
|
||||||
if ($from === $to) {
|
if ($from === $to) {
|
||||||
return $amount;
|
return $amount;
|
||||||
}
|
}
|
||||||
@@ -355,4 +355,10 @@ final class HomePage
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function normalizeCurrency(?string $value, string $fallback = 'EUR'): string
|
||||||
|
{
|
||||||
|
$normalized = strtoupper(trim((string) $value));
|
||||||
|
return $normalized !== '' ? $normalized : $fallback;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user