File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
app/code/core/Mage/Core/Helper
dev/tests/unit/Mage/Core/Helper Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,10 @@ public function validateAgainstBlockMethodBlacklist(Mage_Core_Block_Abstract $bl
43
43
{
44
44
foreach ($ this ->invalidBlockActions as $ action ) {
45
45
$ calledMethod = strtolower ($ method );
46
- if (( $ block instanceof $ action [ ' block ' ] && strtolower ( $ action [ ' method ' ]) === $ calledMethod )
47
- || ( $ block instanceof $ action [ ' block ' ]
48
- && strtolower ( $ action [ ' block ' ] . ' :: ' . $ action [ ' method ' ]) === $ calledMethod )
49
- ) {
46
+ if (str_contains ( $ calledMethod , ' :: ' )) {
47
+ $ calledMethod = explode ( ' :: ' , $ calledMethod )[ 1 ];
48
+ }
49
+ if ( $ block instanceof $ action [ ' block ' ] && strtolower ( $ action [ ' method ' ]) === $ calledMethod ) {
50
50
Mage::throwException (
51
51
sprintf ('Action with combination block %s and method %s is forbidden. ' , get_class ($ block ), $ method )
52
52
);
Original file line number Diff line number Diff line change @@ -65,11 +65,21 @@ public function forbiddenBlockMethodsDataProvider()
65
65
'Mage_Core_Block_Template::fetchView ' ,
66
66
[]
67
67
],
68
+ [
69
+ $ topmenu ,
70
+ 'Mage_Page_Block_Html_Topmenu_Renderer::fetchView ' ,
71
+ []
72
+ ],
68
73
'parent class name is passed as second arg ' => [
69
74
$ topmenu ,
70
75
'Mage_Core_Block_Template::fetchView ' ,
71
76
[]
72
77
],
78
+ 'parent class name is passed as second arg2 ' => [
79
+ $ topmenu ,
80
+ 'Mage_Core_Block_Template::render ' ,
81
+ []
82
+ ],
73
83
];
74
84
}
75
85
You can’t perform that action at this time.
0 commit comments