Skip to content

Commit 6b5eec6

Browse files
committed
Friendlier decimal point “optimization” regex
1 parent 08a0ed0 commit 6b5eec6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sabberworm/CSS/Value/Size.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public function isRelative() {
6161

6262
public function __toString() {
6363
$l = localeconv();
64-
return preg_replace(array('/' . preg_quote($l['decimal_point'], '/') . '/', '/^(-?)0\./'), '$1.', $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
64+
$sPoint = preg_quote($l['decimal_point'], '/');
65+
return preg_replace(array("/$sPoint/", "/^(-?)0\./"), array('.', '$1.'), $this->fSize) . ($this->sUnit === null ? '' : $this->sUnit);
6566
}
6667

6768
}

0 commit comments

Comments
 (0)