From 114f41aa6b5688a96e96144c6f43e81b07dfd99d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Mar 2026 16:55:01 +0000 Subject: [PATCH] fix: add -- to cp -as commands to prevent path/flag confusion Co-authored-by: connortechnology <925519+connortechnology@users.noreply.github.com> --- web/skins/classic/includes/export_functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/skins/classic/includes/export_functions.php b/web/skins/classic/includes/export_functions.php index 02b8eb8bf..3200b56bf 100644 --- a/web/skins/classic/includes/export_functions.php +++ b/web/skins/classic/includes/export_functions.php @@ -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);