From 1fe2959581eb934b38f117dcbdf4e0dbd85bcd03 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 21 Mar 2013 15:20:16 -0600 Subject: [PATCH] Fix Size output for locales that use non-period decimal separators e.g., a locale like pt_PT parses this: width: 0.15em; as "0,15". --- lib/Sabberworm/CSS/Value/Size.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Sabberworm/CSS/Value/Size.php b/lib/Sabberworm/CSS/Value/Size.php index 624805d0..05cf78c3 100644 --- a/lib/Sabberworm/CSS/Value/Size.php +++ b/lib/Sabberworm/CSS/Value/Size.php @@ -60,7 +60,8 @@ public function isRelative() { } public function __toString() { - return str_replace('0.', '.', $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit); + $l = localeconv(); + return str_replace(array($l['decimal_point'], '0.'), '.', $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit); } }