comparison 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
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
205 * 205 *
206 * @throws \Drupal\Core\FileTransfer\FileTransferException 206 * @throws \Drupal\Core\FileTransfer\FileTransferException
207 */ 207 */
208 final protected function checkPath($path) { 208 final protected function checkPath($path) {
209 $full_jail = $this->chroot . $this->jail; 209 $full_jail = $this->chroot . $this->jail;
210 $full_path = drupal_realpath(substr($this->chroot . $path, 0, strlen($full_jail))); 210 $full_path = \Drupal::service('file_system')
211 ->realpath(substr($this->chroot . $path, 0, strlen($full_jail)));
211 $full_path = $this->fixRemotePath($full_path, FALSE); 212 $full_path = $this->fixRemotePath($full_path, FALSE);
212 if ($full_jail !== $full_path) { 213 if ($full_jail !== $full_path) {
213 throw new FileTransferException('@directory is outside of the @jail', NULL, ['@directory' => $path, '@jail' => $this->jail]); 214 throw new FileTransferException('@directory is outside of the @jail', NULL, ['@directory' => $path, '@jail' => $this->jail]);
214 } 215 }
215 } 216 }