mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-12 10:16:18 +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:
@ -93,6 +93,11 @@ class HTMLPurifier_UnitConverter
|
|||||||
$sigfigs = $this->getSigFigs($n);
|
$sigfigs = $this->getSigFigs($n);
|
||||||
if ($sigfigs < $this->outputPrecision) $sigfigs = $this->outputPrecision;
|
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
|
// BCMath's internal precision deals only with decimals. Use
|
||||||
// our default if the initial number has no decimals, or increase
|
// our default if the initial number has no decimals, or increase
|
||||||
// it by how ever many decimals, thus, the number of guard digits
|
// it by how ever many decimals, thus, the number of guard digits
|
||||||
|
Reference in New Issue
Block a user