Skip to content

Commit

Permalink
Merge pull request #180 from tobi-pb/master
Browse files Browse the repository at this point in the history
Using escapeshellarg
  • Loading branch information
Flyingmana committed Apr 18, 2015
2 parents ed01951 + 8b93ec4 commit 8e28d09
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ protected function _symlink($relSourcePath, $destPath, $absSourcePath)
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {
$absSourcePath = str_replace('/', '\\', $absSourcePath);
$param = is_dir($absSourcePath) ? ' /D' : '';
exec('mklink' . $param . ' "' . $destPath . '" "' . $absSourcePath . '"');
exec('mklink' . escapeshellarg($param) . ' "' . escapeshellarg($destPath) . '" "' . escapeshellarg($absSourcePath) . '"');
} else {
symlink($relSourcePath, $destPath);
}
Expand Down

1 comment on commit 8e28d09

@vovayatsyuk
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit breaks symlink on Windows. Will you fix or revert it?

Correct command:

mklink /D "D:\www\public\composertest\htdocs/app/code/community/TM/Core" "D:\www\public\composertest\vendor\tm\core\app\code\community\TM\Core"

Wrong command:

mklink" /D" ""D:\www\public\composertest\htdocs/app/code/community/TM/Core"" ""D:\www\public\composertest\vendor\tm\core\app\code\community\TM\Core""

Please sign in to comment.