Skip to content

Commit

Permalink
Merge pull request #2768 from thomasjacquin/save_file.php-handle-"con…
Browse files Browse the repository at this point in the history
…fig"-web-alias

Update save_file.php: Add "config" check
  • Loading branch information
EricClaeys authored Jun 10, 2023
2 parents 6bc3518 + 8227af4 commit f4c9678
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions html/includes/save_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@
// "website" is a web alias to ALLSKY_WEBSITE.
// $path is the web address to the file; we need the physical path ($file) to move.
if (substr($path, 0, 7) === "current")
$file = str_replace('current', ALLSKY_HOME, $path);
$file = str_replace('current/', ALLSKY_HOME . "/", $path);
else if (substr($path, 0, 6) === "config")
$file = str_replace('config/', ALLSKY_CONFIG . "/", $path);
else // website
$file = str_replace('website', ALLSKY_WEBSITE, $path);
$file = str_replace('website/', ALLSKY_WEBSITE . "/", $path);
if (! file_exists($file)) {
echo "E File to save '$file' does not exist!";
exit;
echo "E File to save '$file' does not exist (path=$path)!";
exit(1);
}

$ok = true;
Expand Down

0 comments on commit f4c9678

Please sign in to comment.