Skip to content

Commit 732889b

Browse files
committed
fixed double slashes in getRelativePath()
1 parent 3ed8ba0 commit 732889b

File tree

1 file changed

+6
-0
lines changed
  • src/MagentoHackathon/Composer/Magento/Deploystrategy

1 file changed

+6
-0
lines changed

src/MagentoHackathon/Composer/Magento/Deploystrategy/Symlink.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,19 @@ protected function _symlink($relSourcePath, $destPath, $absSourcePath)
128128
*/
129129
public function getRelativePath($from, $to)
130130
{
131+
// Can't use realpath() here since the destination doesn't exist yet
131132
$from = is_dir($from) ? rtrim($from, '\/') . '/' : $from;
132133
$to = is_dir($to) ? rtrim($to, '\/') . '/' : $to;
134+
133135
$from = str_replace('\\', '/', $from);
134136
$to = str_replace('\\', '/', $to);
135137

138+
$from = str_replace(array('/./', '//'), '/', $from);
139+
$to = str_replace(array('/./', '//'), '/', $to);
140+
136141
$from = explode('/', $from);
137142
$to = explode('/', $to);
143+
138144
$relPath = $to;
139145

140146
foreach ($from as $depth => $dir) {

0 commit comments

Comments
 (0)