We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4586539 commit 37edae1Copy full SHA for 37edae1
app/code/core/Mage/Core/Model/Layout.php
@@ -595,8 +595,15 @@ public function getMessagesBlock()
595
public function getBlockSingleton($type)
596
{
597
if (!isset($this->_helpers[$type])) {
598
- $helper = $this->_getBlockInstance($type);
599
- $helper->setLayout($this);
+ $className = Mage::getConfig()->getBlockClassName($type);
+ if ($className === false || !class_exists($className)) {
600
+ Mage::throwException(Mage::helper('core')->__('Invalid block type: %s', $type));
601
+ }
602
+ // phpcs:ignore Ecg.Classes.ObjectInstantiation.DirectInstantiation
603
+ $helper = new $className();
604
+ if ($helper instanceof Mage_Core_Block_Abstract) {
605
+ $helper->setLayout($this);
606
607
$this->_helpers[$type] = $helper;
608
}
609
return $this->_helpers[$type];
0 commit comments