File tree Expand file tree Collapse file tree 3 files changed +14
-20
lines changed Expand file tree Collapse file tree 3 files changed +14
-20
lines changed Original file line number Diff line number Diff line change 1212 */
1313class InsecureFunctionSniff extends ForbiddenFunctionsSniff
1414{
15- /**
16- * If true, an error will be thrown; otherwise a warning.
17- *
18- * @var boolean
19- */
20- public $ error = false ;
21-
2215 /**
2316 * List of patterns for forbidden functions.
2417 *
@@ -38,7 +31,7 @@ class InsecureFunctionSniff extends ForbiddenFunctionsSniff
3831 'system ' => null ,
3932 'unserialize ' => '\Magento\Framework\Serialize\SerializerInterface::unserialize ' ,
4033 'srand ' => null ,
41- 'mt_srand ' => null ,
34+ 'mt_srand ' => null ,
4235 'mt_rand ' => 'random_int ' ,
4336 ];
4437}
Original file line number Diff line number Diff line change 33 * Copyright © Magento. All rights reserved.
44 * See COPYING.txt for license details.
55 */
6+
67namespace Magento2 \Tests \Security ;
78
89use PHP_CodeSniffer \Tests \Standards \AbstractSniffUnitTest ;
@@ -16,14 +17,6 @@ class InsecureFunctionUnitTest extends AbstractSniffUnitTest
1617 * @inheritdoc
1718 */
1819 public function getErrorList ()
19- {
20- return [];
21- }
22-
23- /**
24- * @inheritdoc
25- */
26- public function getWarningList ()
2720 {
2821 return [
2922 3 => 1 ,
@@ -43,4 +36,12 @@ public function getWarningList()
4336 31 => 1 ,
4437 ];
4538 }
39+
40+ /**
41+ * @inheritdoc
42+ */
43+ public function getWarningList ()
44+ {
45+ return [];
46+ }
4647}
Original file line number Diff line number Diff line change 6565 <exclude-pattern >*/Test/*</exclude-pattern >
6666 <exclude-pattern >*Test.php</exclude-pattern >
6767 </rule >
68+ <rule ref =" Magento2.Security.InsecureFunction" >
69+ <severity >10</severity >
70+ <type >error</type >
71+ </rule >
6872 <rule ref =" Magento2.Security.LanguageConstruct" >
6973 <severity >10</severity >
7074 <type >error</type >
104108 <severity >9</severity >
105109 <type >warning</type >
106110 </rule >
107- <rule ref =" Magento2.Security.InsecureFunction" >
108- <severity >9</severity >
109- <type >warning</type >
110- </rule >
111111 <rule ref =" Magento2.Security.Superglobal.SuperglobalUsageWarning" >
112112 <severity >9</severity >
113113 <type >warning</type >
You can’t perform that action at this time.
0 commit comments