Skip to content

Commit afc47a3

Browse files
committed
MAGETWO-95628: Filesystem Directory Improvement
1 parent 8cffab2 commit afc47a3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/internal/Magento/Framework/Filesystem/Directory/PathValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function validate(
4040
$absolutePath = false
4141
) {
4242
$realDirectoryPath = $this->driver->getRealPathSafety($directoryPath);
43-
if ($realDirectoryPath[-1] !== DIRECTORY_SEPARATOR) {
43+
if (substr($realDirectoryPath, -1) !== DIRECTORY_SEPARATOR) {
4444
$realDirectoryPath .= DIRECTORY_SEPARATOR;
4545
}
4646
if (!$absolutePath) {

lib/internal/Magento/Framework/Filesystem/Directory/Read.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public function read($path = null)
138138
foreach ($files as $file) {
139139
$result[] = $this->getRelativePath($file);
140140
}
141+
141142
return $result;
142143
}
143144

@@ -158,6 +159,7 @@ public function readRecursively($path = null)
158159
$result[] = $this->getRelativePath($file);
159160
}
160161
sort($result);
162+
161163
return $result;
162164
}
163165

@@ -183,6 +185,7 @@ public function search($pattern, $path = null)
183185
foreach ($files as $file) {
184186
$result[] = $this->getRelativePath($file);
185187
}
188+
186189
return $result;
187190
}
188191

@@ -259,8 +262,8 @@ public function readFile($path, $flag = null, $context = null)
259262
$this->validatePath($path);
260263

261264
$absolutePath = $this->driver->getAbsolutePath($this->path, $path);
262-
return $this->driver->fileGetContents($absolutePath, $flag, $context);
263265

266+
return $this->driver->fileGetContents($absolutePath, $flag, $context);
264267
}
265268

266269
/**

0 commit comments

Comments
 (0)