Browse Source

Fix phpcs errors

improve_error_ms_for_permissions
Don Richards 2 years ago committed by GitHub
parent
commit
e4639be409
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/MediaSource/MediaSourceService.php

2
src/MediaSource/MediaSourceService.php

@ -293,7 +293,7 @@ class MediaSourceService {
if (!$this->fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS)) { if (!$this->fileSystem->prepareDirectory($directory, FileSystemInterface::CREATE_DIRECTORY | FileSystemInterface::MODIFY_PERMISSIONS)) {
$parent_directory = dirname($directory); $parent_directory = dirname($directory);
$error_current_user = shell_exec('whoami'); $error_current_user = shell_exec('whoami');
$sanitized_current_user = str_replace(array("\n", "\r"), '', $error_current_user); $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"; $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); $this->logger->error($error_message);
throw new HttpException(500, "An error occurred while processing your request. Please contact the website administrator."); throw new HttpException(500, "An error occurred while processing your request. Please contact the website administrator.");

Loading…
Cancel
Save