fix: add -- to cp -as commands to prevent path/flag confusion

Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com>
copilot/sub-pr-4694
copilot-swe-agent[bot] 2026-03-09 16:55:01 +00:00
parent fedd541e18
commit 114f41aa6b
1 changed files with 3 additions and 3 deletions

View File

@ -951,14 +951,14 @@ function exportEvents(
#continue;
if ($exportStructure == 'flat') {
if (false !== strpos($file, strval($event->Id()))) {
$cmd = 'cp -as '.escapeshellarg($event->Path().'/'.$file).' '.escapeshellarg($export_dir.'/'.$file). ' 2>&1';
$cmd = 'cp -as -- '.escapeshellarg($event->Path().'/'.$file).' '.escapeshellarg($export_dir.'/'.$file). ' 2>&1';
$exportFileList[] = $file;
} else {
$cmd = 'cp -as '.escapeshellarg($event->Path().'/'.$file).' '.escapeshellarg($export_dir.'/'.$event->Id().'_'.$file). ' 2>&1';
$cmd = 'cp -as -- '.escapeshellarg($event->Path().'/'.$file).' '.escapeshellarg($export_dir.'/'.$event->Id().'_'.$file). ' 2>&1';
$exportFileList[] = $event->Id().'_'.$file;
}
} else {
$cmd = 'cp -as '.escapeshellarg($event->Path().'/'.$file).' '.escapeshellarg($export_dir.'/'.$event->Id().'/'.$file). ' 2>&1';
$cmd = 'cp -as -- '.escapeshellarg($event->Path().'/'.$file).' '.escapeshellarg($export_dir.'/'.$event->Id().'/'.$file). ' 2>&1';
$exportFileList[] = $event->Id().'/'.$file;
}
exec($cmd, $output, $return);