File size: 2,093 Bytes
352fe2e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | diff --git a/app/code/core/Mage/Core/Helper/Security.php b/app/code/core/Mage/Core/Helper/Security.php
index da9c01f1edc..1291d8753af 100644
--- a/app/code/core/Mage/Core/Helper/Security.php
+++ b/app/code/core/Mage/Core/Helper/Security.php
@@ -43,10 +43,10 @@ public function validateAgainstBlockMethodBlacklist(Mage_Core_Block_Abstract $bl
{
foreach ($this->invalidBlockActions as $action) {
$calledMethod = strtolower($method);
- if (($block instanceof $action['block'] && strtolower($action['method']) === $calledMethod)
- || ($block instanceof $action['block']
- && strtolower($action['block'] . '::' . $action['method']) === $calledMethod)
- ) {
+ if (str_contains($calledMethod, '::')) {
+ $calledMethod = explode('::', $calledMethod)[1];
+ }
+ if ($block instanceof $action['block'] && strtolower($action['method']) === $calledMethod) {
Mage::throwException(
sprintf('Action with combination block %s and method %s is forbidden.', get_class($block), $method)
);
diff --git a/dev/tests/unit/Mage/Core/Helper/Security.php b/dev/tests/unit/Mage/Core/Helper/Security.php
index e27cf28ce5f..f0b11f593e6 100644
--- a/dev/tests/unit/Mage/Core/Helper/Security.php
+++ b/dev/tests/unit/Mage/Core/Helper/Security.php
@@ -65,11 +65,21 @@ public function forbiddenBlockMethodsDataProvider()
'Mage_Core_Block_Template::fetchView',
[]
],
+ [
+ $topmenu,
+ 'Mage_Page_Block_Html_Topmenu_Renderer::fetchView',
+ []
+ ],
'parent class name is passed as second arg' => [
$topmenu,
'Mage_Core_Block_Template::fetchView',
[]
],
+ 'parent class name is passed as second arg2' => [
+ $topmenu,
+ 'Mage_Core_Block_Template::render',
+ []
+ ],
];
}
|