#248 More flexible checking for float value
This commit is contained in:
parent
d9a2c4c3ca
commit
d7f3d25b2a
@ -245,7 +245,7 @@ abstract class AbstractStyle
|
|||||||
if (is_string($value) && (preg_match('/[^\d\.\,]/', $value) == 0)) {
|
if (is_string($value) && (preg_match('/[^\d\.\,]/', $value) == 0)) {
|
||||||
$value = floatval($value);
|
$value = floatval($value);
|
||||||
}
|
}
|
||||||
if (!is_float($value)) {
|
if (!is_numeric($value)) {
|
||||||
$value = $default;
|
$value = $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -250,7 +250,7 @@ class Image extends AbstractStyle
|
|||||||
*/
|
*/
|
||||||
public function setMarginTop($value = 0)
|
public function setMarginTop($value = 0)
|
||||||
{
|
{
|
||||||
$this->marginTop = $this->setFloatVal($value, 0);
|
$this->marginTop = $this->setNumericVal($value, 0);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -273,7 +273,7 @@ class Image extends AbstractStyle
|
|||||||
*/
|
*/
|
||||||
public function setMarginLeft($value = 0)
|
public function setMarginLeft($value = 0)
|
||||||
{
|
{
|
||||||
$this->marginLeft = $this->setFloatVal($value, 0);
|
$this->marginLeft = $this->setNumericVal($value, 0);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user