1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-11 17:56:19 +02:00

Fix PHP 4.3.9/10 bug with float handling

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/branches/php4@1806 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-06-19 21:13:56 +00:00
parent e80a54a7c9
commit 2cc829a8cf

View File

@ -93,6 +93,11 @@ class HTMLPurifier_UnitConverter
$sigfigs = $this->getSigFigs($n);
if ($sigfigs < $this->outputPrecision) $sigfigs = $this->outputPrecision;
// Cleanup $n for PHP 4.3.9 and 4.3.10. See http://bugs.php.net/bug.php?id=30726
if (strncmp($n, '-.', 2) === 0) {
$n = '-0.' . substr($n, 2);
}
// BCMath's internal precision deals only with decimals. Use
// our default if the initial number has no decimals, or increase
// it by how ever many decimals, thus, the number of guard digits