Skip to content

Commit

Permalink
Revert "Dev: avoid empty values in SRC or URL"
Browse files Browse the repository at this point in the history
This reverts commit 42c1de6.
  • Loading branch information
LouisGac committed Apr 9, 2019
1 parent 7eaaba3 commit e245f0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions application/core/LS_Twig_Extension.php
Expand Up @@ -268,7 +268,7 @@ public static function assetPublish($sRessource)
public static function image($sImagePath, $alt = '', $htmlOptions = array( ))
{
$sUrlImgAsset = self::imageSrc($sImagePath,'');
if( $sUrlImgAsset === "ERROR") {
if(!$sUrlImgAsset) {
return '';
}
return CHtml::image($sUrlImgAsset, $alt, $htmlOptions);
Expand All @@ -292,7 +292,7 @@ public static function imageSrc($sImagePath, $default = false)
if($default) {
return self::imageSrc($default);
}
return "ERROR";
return false;
}
$sFullPath = Yii::app()->getConfig('rootdir').'/'.$sImagePath;
}
Expand All @@ -301,7 +301,7 @@ public static function imageSrc($sImagePath, $default = false)
$checkImage = LSYii_ImageValidator::validateImage($sFullPath);

if (!$checkImage['check']) {
return "ERROR";
return false;
}

$sUrlImgAsset = self::assetPublish($sFullPath);
Expand Down

0 comments on commit e245f0c

Please sign in to comment.