Skip to content

Commit 44fd600

Browse files
authored
AC-9509: Scheduled operation improvements
1 parent a4a5a32 commit 44fd600

File tree

1 file changed

+3
-1
lines changed
  • lib/internal/Magento/Framework/Filesystem/File

1 file changed

+3
-1
lines changed

lib/internal/Magento/Framework/Filesystem/File/Write.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ protected function assertValid()
3434
{
3535
$fileExists = $this->driver->isExists($this->path);
3636
$mode = $this->mode ?? '';
37-
if (!$fileExists && preg_match('/r/', $mode)) {
37+
if (preg_match('/(?:^-|\s-)/', $this->path)) {
38+
throw new FileSystemException(new \Magento\Framework\Phrase('The file "%1" can\' be allowed', [$this->path]));
39+
} elseif (!$fileExists && preg_match('/r/', $mode)) {
3840
throw new FileSystemException(
3941
new \Magento\Framework\Phrase('The "%1" file doesn\'t exist.', [$this->path])
4042
);

0 commit comments

Comments
 (0)