Skip to content

Commit 920cb14

Browse files
Merge branch 'MAGETWO-95928' into 2.3-bugfixes-020119
# Conflicts: # dev/tests/static/framework/Magento/CodeMessDetector/resources/rulesets/design.xml # dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml
2 parents 51e76a3 + cdc0941 commit 920cb14

File tree

4 files changed

+0
-87
lines changed

4 files changed

+0
-87
lines changed

app/code/Magento/Widget/Block/Adminhtml/Widget.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class Widget extends \Magento\Backend\Block\Widget\Form\Container
1616
{
1717
/**
1818
* @inheritdoc
19-
*
20-
* @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
2119
*/
2220
protected function _construct()
2321
{

dev/tests/static/framework/Magento/CodeMessDetector/Rule/Design/RequestAwareBlockMethod.php

Lines changed: 0 additions & 53 deletions
This file was deleted.

dev/tests/static/framework/Magento/CodeMessDetector/resources/rulesets/design.xml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -83,37 +83,6 @@ class OrderProcessor
8383
$currentOrder = $this->session->get('current_order');
8484
...
8585
}
86-
}
87-
]]>
88-
</example>
89-
</rule>
90-
<rule name="RequestAwareBlockMethod"
91-
class="Magento\CodeMessDetector\Rule\Design\RequestAwareBlockMethod"
92-
message="{0} uses request object directly. Add user input validation and suppress this warning.">
93-
<description>
94-
<![CDATA[
95-
Blocks must not depend on being used with certain controllers.
96-
If you use request object in a block directly you must validate all user input inside the block.
97-
]]>
98-
</description>
99-
<priority>2</priority>
100-
<properties />
101-
<example>
102-
<![CDATA[
103-
class MyOrder extends AbstractBlock
104-
{
105-
106-
.......
107-
108-
public function getOrder()
109-
{
110-
$orderId = $this->getRequest()->getParam('order_id');
111-
//Validate customer having such order.
112-
if (!$this->hasOrder($this->getCustomerId(), $orderId)) {
113-
...deny access...
114-
}
115-
.....
116-
}
11786
}
11887
]]>
11988
</example>

dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
<!-- Magento Specific Rules -->
4949
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/FinalImplementation" />
5050
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/AllPurposeAction" />
51-
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/RequestAwareBlockMethod" />
5251
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/CookieAndSessionMisuse" />
5352

5453
</ruleset>

0 commit comments

Comments
 (0)