Compare commits

...

5 Commits

Author SHA1 Message Date
Don Richards e4639be409
Fix phpcs errors 2 years ago
Don Richards c1ace5a2da
Replace the watchdog output 2 years ago
Don Richards 9bd4e8c5c0
Update MediaSourceService.php 2 years ago
Don Richards 80391bc372
Moved into existing check 2 years ago
Don Richards 5585f89e9a
Update MediaSourceService.php 2 years ago
  1. 8
      src/MediaSource/MediaSourceService.php

8
src/MediaSource/MediaSourceService.php

@ -289,8 +289,14 @@ class MediaSourceService {
}
$directory = $this->fileSystem->dirname($content_location);
if (!$this->fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS)) {
throw new HttpException(500, "The destination directory does not exist, could not be created, or is not writable");
$parent_directory = dirname($directory);
$error_current_user = shell_exec('whoami');
$sanitized_current_user = str_replace(["\n", "\r"], '', $error_current_user);
$error_message = "The destination directory does not exist, could not be created, or is not writable by $sanitized_current_user: $directory";
$this->logger->error($error_message);
throw new HttpException(500, "An error occurred while processing your request. Please contact the website administrator.");
}
// Copy over the file content.

Loading…
Cancel
Save