diff core/lib/Drupal/Core/FileTransfer/FileTransfer.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children af1871eacc83
line wrap: on
line diff
--- a/core/lib/Drupal/Core/FileTransfer/FileTransfer.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/lib/Drupal/Core/FileTransfer/FileTransfer.php	Mon Apr 23 09:46:53 2018 +0100
@@ -207,7 +207,8 @@
    */
   final protected function checkPath($path) {
     $full_jail = $this->chroot . $this->jail;
-    $full_path = drupal_realpath(substr($this->chroot . $path, 0, strlen($full_jail)));
+    $full_path = \Drupal::service('file_system')
+      ->realpath(substr($this->chroot . $path, 0, strlen($full_jail)));
     $full_path = $this->fixRemotePath($full_path, FALSE);
     if ($full_jail !== $full_path) {
       throw new FileTransferException('@directory is outside of the @jail', NULL, ['@directory' => $path, '@jail' => $this->jail]);