1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 05:37:49 +02:00

fix: Support for locales using decimal separators other than . (dot) (#372)

* Bugfix UnitConverter expects float got string (strict types enabled)

* Bugfix for latest bugfix with huge numbers

* Bugfix for german locale

* Use number_format instead of str_replace(sprintf())
This commit is contained in:
cracksalad
2023-04-30 15:30:23 +02:00
committed by GitHub
parent c05639e0c9
commit 43f49ac9a5
2 changed files with 10 additions and 3 deletions

View File

@@ -101,6 +101,13 @@ class HTMLPurifier_UnitConverterTest extends HTMLPurifier_Harness
$this->assertConversion('111.12pt', '1.5433in');
$this->assertConversion('11.112pt', '0.15433in');
}
public function testDecimalSeparatorComma()
{
setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'deu_deu');
$this->assertConversion('11.11px', '0.294cm');
setlocale(LC_ALL, '');
}
public function testRoundingBigNumber()
{