Skip to content

Commit 8673f24

Browse files
authored
Merge pull request #73 from magento/update-functions
Made InsecureFunctionSniff in line with UnsecureFunctionsUsageTest
2 parents a8004cc + 8349141 commit 8673f24

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Magento2/Sniffs/Security/InsecureFunctionSniff.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ class InsecureFunctionSniff extends ForbiddenFunctionsSniff
3333
'pcntl_exec' => null,
3434
'popen' => null,
3535
'proc_open' => null,
36-
'serialize' => 'json_encode',
36+
'serialize' => '\Magento\Framework\Serialize\SerializerInterface::serialize',
3737
'shell_exec' => null,
3838
'system' => null,
39-
'unserialize' => 'json_decode',
39+
'unserialize' => '\Magento\Framework\Serialize\SerializerInterface::unserialize',
40+
'srand' => null,
41+
'mt_srand'=> null,
4042
];
4143
}

Magento2/Tests/Security/InsecureFunctionUnitTest.inc

+4
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ proc_open('echo 1;');
2323
create_function('args', 'code');
2424

2525
pcntl_exec('path/goes/here');
26+
27+
srand();
28+
29+
mt_srand();

Magento2/Tests/Security/InsecureFunctionUnitTest.php

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public function getWarningList()
3838
21 => 1,
3939
23 => 1,
4040
25 => 1,
41+
27 => 1,
42+
29 => 1,
4143
];
4244
}
4345
}

0 commit comments

Comments
 (0)