From 1bbcff4eb26e63611b2372ff74084cb2afb62a8f Mon Sep 17 00:00:00 2001 From: joost-florijn-kega Date: Wed, 2 Nov 2016 08:54:55 +0100 Subject: [PATCH] Replace filter_var to make the intention of the code clearer --- app/code/Magento/Catalog/Model/Product/Image.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Catalog/Model/Product/Image.php b/app/code/Magento/Catalog/Model/Product/Image.php index 8067d6270b64a..b32abc1310498 100644 --- a/app/code/Magento/Catalog/Model/Product/Image.php +++ b/app/code/Magento/Catalog/Model/Product/Image.php @@ -278,7 +278,7 @@ public function getQuality() */ public function setKeepAspectRatio($keep) { - $this->_keepAspectRatio = filter_var($keep, FILTER_VALIDATE_BOOLEAN); + $this->_keepAspectRatio = $keep && $keep !== 'false'; return $this; } @@ -288,7 +288,7 @@ public function setKeepAspectRatio($keep) */ public function setKeepFrame($keep) { - $this->_keepFrame = filter_var($keep, FILTER_VALIDATE_BOOLEAN); + $this->_keepFrame = $keep && $keep !== 'false'; return $this; } @@ -298,7 +298,7 @@ public function setKeepFrame($keep) */ public function setKeepTransparency($keep) { - $this->_keepTransparency = filter_var($keep, FILTER_VALIDATE_BOOLEAN); + $this->_keepTransparency = $keep && $keep !== 'false'; return $this; } @@ -308,7 +308,7 @@ public function setKeepTransparency($keep) */ public function setConstrainOnly($flag) { - $this->_constrainOnly = filter_var($flag, FILTER_VALIDATE_BOOLEAN); + $this->_constrainOnly = $flag && $flag !== 'false'; return $this; }