diff --git a/core/lib/Drupal/Core/StreamWrapper/LocalStream.php b/core/lib/Drupal/Core/StreamWrapper/LocalStream.php index ae0a435..db51eda 100644 --- a/core/lib/Drupal/Core/StreamWrapper/LocalStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/LocalStream.php @@ -132,7 +132,7 @@ protected function getLocalPath($uri = NULL) { if (!isset($uri)) { $uri = $this->uri; } - $path = $this->getDirectoryPath() . DIRECTORY_SEPARATOR . $this->getTarget($uri); + $path = $this->getDirectoryPath() . '/' . $this->getTarget($uri); // In PHPUnit tests, the base path for local streams may be a virtual // filesystem stream wrapper URI, in which case this local stream acts like @@ -145,7 +145,7 @@ protected function getLocalPath($uri = NULL) { $realpath = realpath($path); if (!$realpath) { // This file does not yet exist. - $realpath = realpath(dirname($path)) . DIRECTORY_SEPARATOR . drupal_basename($path); + $realpath = realpath(dirname($path)) . '/' . drupal_basename($path); } $directory = realpath($this->getDirectoryPath()); if (!$realpath || !$directory || strpos($realpath, $directory) !== 0) { @@ -453,7 +453,7 @@ public function mkdir($uri, $mode, $options) { if ($recursive) { // $this->getLocalPath() fails if $uri has multiple levels of directories // that do not yet exist. - $localpath = $this->getDirectoryPath() . DIRECTORY_SEPARATOR . $this->getTarget($uri); + $localpath = $this->getDirectoryPath() . '/' . $this->getTarget($uri); } else { $localpath = $this->getLocalPath($uri); diff --git a/core/modules/system/src/Tests/File/SystemStreamTest.php b/core/modules/system/src/Tests/File/SystemStreamTest.php index 94c85db..4bb8b0e 100644 --- a/core/modules/system/src/Tests/File/SystemStreamTest.php +++ b/core/modules/system/src/Tests/File/SystemStreamTest.php @@ -462,10 +462,6 @@ private function runTestOnInstanceMethod(StreamWrapperInterface $instance, $meth } } elseif (is_string($case)) { - if ($method == 'realpath') { - // realpath() returns strings with OS-specific DIRECTORY_SEPARATOR. - $case = str_replace('/', DIRECTORY_SEPARATOR, $case); - } $this->assertEqual($instance->$method(), $case); } }