Download tasks/11ac5a8dcfc146f0/source/patch.diff from FuCY/php: direct link, hf CLI and curl.
- Browser
- Download file 2.09 kB
-
https://huggingface.co/datasets/FuCY/php/resolve/main/tasks/11ac5a8dcfc146f0/source/patch.diff
- Command line
-
hf download hf://datasets/FuCY/php/tasks/11ac5a8dcfc146f0/source/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/FuCY/php/resolve/main/tasks/11ac5a8dcfc146f0/source/patch.diff
2.09 kB
| 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 | |
| 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 | |
| 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', | |
| + [] | |
| + ], | |
| ]; | |
| } | |