diff --git a/core/lib/Drupal/Core/File/FileSystem.php b/core/lib/Drupal/Core/File/FileSystem.php index 02175f9..e7fe451 100644 --- a/core/lib/Drupal/Core/File/FileSystem.php +++ b/core/lib/Drupal/Core/File/FileSystem.php @@ -73,7 +73,9 @@ public function __construct(StreamWrapperManagerInterface $stream_wrapper_manage * {@inheritdoc} */ public function moveUploadedFile($filename, $uri) { - $result = @move_uploaded_file($filename, $uri); + // Resolved the destination URI. + $destination = \Drupal::service('file_system')->realpath($uri) ?: $uri; + $result = \Drupal::service('file_system')->moveUploadedFile($filename, $destination); // PHP's move_uploaded_file() does not properly support streams if // open_basedir is enabled so if the move failed, try finding a real path // and retry the move operation.