File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
app/code/core/Mage/Core/Model Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -595,8 +595,15 @@ public function getMessagesBlock()
595
595
public function getBlockSingleton ($ type )
596
596
{
597
597
if (!isset ($ this ->_helpers [$ type ])) {
598
- $ helper = $ this ->_getBlockInstance ($ type );
599
- $ helper ->setLayout ($ this );
598
+ $ className = Mage::getConfig ()->getBlockClassName ($ type );
599
+ 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
+ }
600
607
$ this ->_helpers [$ type ] = $ helper ;
601
608
}
602
609
return $ this ->_helpers [$ type ];
You can’t perform that action at this time.
0 commit comments