Skip to content

Commit 1044f25

Browse files
committed
Escape dollar sign for saving content into crontab
The crontab contents can contain dollar sign (e.g. $(date)). The current code does not escape it which transform it to actual values. In this commit a replacement to escape dollar sign is added to the previous replacements.
1 parent c2e2646 commit 1044f25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/Magento/Framework/Crontab/CrontabManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ private function getCrontabContent()
203203
*/
204204
private function save($content)
205205
{
206-
$content = str_replace(['%', '"'], ['%%', '\"'], $content);
206+
$content = str_replace(['%', '"', '$'], ['%%', '\"', '\$'], $content);
207207

208208
try {
209209
$this->shell->execute('echo "' . $content . '" | crontab -');

0 commit comments

Comments
 (0)