Skip to content

Commit 40c9ddb

Browse files
committed
AC-9509: Scheduled operation improvements.
1 parent 91f3bb4 commit 40c9ddb

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

lib/internal/Magento/Framework/Filter/Input/MaliciousCode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(?PurifierInterface $purifier = null)
5151
//base64 usage
5252
'/src=[^<]*base64[^<]*(?=\/*\>)/Uis',
5353
//command line injections
54-
'/[|$`;!]/',
54+
'/[|$`;!&]/',
5555
];
5656

5757
/**

lib/internal/Magento/Framework/Filter/Test/Unit/Input/MaliciousCodeTest.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ public function testFilter($input, $expectedOutput)
5151
{
5252
$this->purifier->expects(self::atLeastOnce())
5353
->method('purify')
54-
->willReturn($expectedOutput);
55-
54+
->will(
55+
$this->returnCallback(function ($arg) {
56+
return $arg;
57+
})
58+
);
5659
self::assertEquals($expectedOutput, $this->filter->filter($input));
5760
}
5861

@@ -132,7 +135,7 @@ public function filterDataProvider()
132135
],
133136
'Nested malicious tags' => [
134137
'<scri<script>pt>alert(1);</scri<script>pt>',
135-
'alert(1);',
138+
'alert(1)',
136139
],
137140
'Nested scripts' => [
138141
'<?php echo "test" ?>',
@@ -146,6 +149,10 @@ public function filterDataProvider()
146149
'<?=$test?>',
147150
'',
148151
],
152+
'Commandline injections' => [
153+
'ping -c3 www.example.com && links www.sample.com',
154+
'ping -c3 www.example.com links www.sample.com',
155+
],
149156
'Null Value' => [null, ''],
150157
];
151158
}

0 commit comments

Comments
 (0)