Skip to content

Commit ddeb801

Browse files
committed
Merge remote-tracking branch 'ogresCE/MAGETWO-42038-cron-dos' into PR_Branch
2 parents 73e342f + 0f11e14 commit ddeb801

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ public function execute(\Magento\Framework\Event\Observer $observer)
148148
$jobGroupsRoot = $this->_config->getJobs();
149149

150150
foreach ($jobGroupsRoot as $groupId => $jobsRoot) {
151-
if ($this->_request->getParam('group') !== null && $this->_request->getParam('group') != $groupId) {
151+
if ($this->_request->getParam('group') !== null
152+
&& $this->_request->getParam('group') !== '\'' . ($groupId) . '\''
153+
&& $this->_request->getParam('group') !== $groupId) {
152154
continue;
153155
}
154156
if (($this->_request->getParam(self::STANDALONE_PROCESS_STARTED) !== '1') && (

pub/cron.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@
1111

1212
require dirname(__DIR__) . '/app/bootstrap.php';
1313

14-
if ($_GET){
15-
$opt = $_GET;
16-
} else {
14+
if (php_sapi_name() === 'cli'){
1715
echo "You cannot run this from the command line." . PHP_EOL .
1816
"Run \"php bin/magento cron:run\" instead." . PHP_EOL;
1917
exit(1);
18+
} else {
19+
$opt = $_GET;
2020
}
2121

2222
try {
2323
if (empty($opt['group'])) {
2424
$opt['group'] = 'default';
2525
}
26+
foreach ($opt as $key => $value) {
27+
$opt[$key] = escapeshellarg($value);
28+
}
2629
$opt['standaloneProcessStarted'] = '0';
2730
$params = $_SERVER;
2831
$params[StoreManager::PARAM_RUN_CODE] = 'admin';

0 commit comments

Comments
 (0)