[TASK] Optimize invocation of cObj::checkIf
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / ImageContentObject.php
index b907c3e..3400cb2 100644 (file)
@@ -28,13 +28,15 @@ class ImageContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
         * @return string Output
         */
        public function render($conf = array()) {
-               if ($this->cObj->checkIf($conf['if.'])) {
-                       $theValue = $this->cObj->cImage($conf['file'], $conf);
-                       if (isset($conf['stdWrap.'])) {
-                               $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
-                       }
-                       return $theValue;
+               if (!empty($conf['if.']) && !$this->cObj->checkIf($conf['if.'])) {
+                       return '';
                }
+
+               $theValue = $this->cObj->cImage($conf['file'], $conf);
+               if (isset($conf['stdWrap.'])) {
+                       $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
+               }
+               return $theValue;
        }
 
 }