From c5314f6ed0775674a39fffb8ed12c24b4ef630dc Mon Sep 17 00:00:00 2001 From: Tymoteusz Motylewski Date: Tue, 9 Jun 2015 14:11:40 +0200 Subject: [PATCH] Better log msg when template file doesn't exist. Before, if Magento was not able to locate a file, and error like this was logged: 2015-06-09T11:32:35+00:00 ERR (3): Warning: include(): Filename cannot be empty in app/code/core/Mage/Core/Block/Template.php on line 241 Which is not very helpful. This change makes Magento log a filename and also fixes the one parameter too much in the Mage::log call. --- app/code/core/Mage/Core/Block/Template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index ca14daa5945..f92e265d229 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -237,10 +237,10 @@ public function fetchView($fileName) try { $includeFilePath = realpath($this->_viewDir . DS . $fileName); - if (strpos($includeFilePath, realpath($this->_viewDir)) === 0 || $this->_getAllowSymlinks()) { + if ($includeFilePath != '' && (strpos($includeFilePath, realpath($this->_viewDir)) === 0 || $this->_getAllowSymlinks())) { include $includeFilePath; } else { - Mage::log('Not valid template file:'.$fileName, Zend_Log::CRIT, null, null, true); + Mage::log('Not valid template file:'.$fileName, Zend_Log::CRIT, null, true); } } catch (Exception $e) {