Skip to content
Browse files

Disable download and revisit tomorrow

  • Loading branch information...
1 parent 9249074 commit 110603e4e2b03456e303779cc3b69cbc3208a7c8 @sullrich sullrich committed Sep 25, 2011
Showing with 19 additions and 17 deletions.
  1. +19 −17 usr/local/www/system_firmware_restorefullbackup.php
View
36 usr/local/www/system_firmware_restorefullbackup.php
@@ -63,21 +63,23 @@
if($_GET['downloadbackup']) {
$filename = $_GET['downloadbackup'];
- session_cache_limiter('public');
- $fd = fopen($filename, "rb");
- header("Content-Type: application/octet-stream");
- header("Content-Length: " . filesize("/root/" . escapeshellcmd($filename)));
- header("Content-Disposition: attachment; filename=\"" .
- trim(htmlentities(basename("/root/" . escapeshellcmd($filename)))) . "\"");
- if (isset($_SERVER['HTTPS'])) {
- header('Pragma: ');
- header('Cache-Control: ');
- } else {
- header("Pragma: private");
- header("Cache-Control: private, must-revalidate");
+ if(file_exists("/root/{$filename}")) {
+ session_cache_limiter('public');
+ $fd = fopen("/root/" . $filename, "rb");
+ header("Content-Type: application/octet-stream");
+ header("Content-Length: " . filesize("/root/" . $filename));
+ header("Content-Disposition: attachment; filename=\"" .
+ trim(htmlentities(basename($filename))) . "\"");
+ if (isset($_SERVER['HTTPS'])) {
+ header('Pragma: ');
+ header('Cache-Control: ');
+ } else {
+ header("Pragma: private");
+ header("Cache-Control: private, must-revalidate");
+ }
+ fpassthru($fd);
+ exit;
}
- fpassthru($fd);
- exit;
}
if ($_GET['deletefile']) {
@@ -156,9 +158,9 @@
echo "<a onclick=\"return confirm('" . gettext("Do you really want to delete this backup?") . "')\" href='system_firmware_restorefullbackup.php?deletefile=" . htmlspecialchars($arf) . "'>";
echo gettext("Delete");
echo "</a> | ";
- echo "<a href='system_firmware_restorefullbackup.php?downloadbackup=" . htmlspecialchars($arf) . "'>";
- echo gettext("Download");
- echo "</a>";
+ //echo "<a href='system_firmware_restorefullbackup.php?downloadbackup=" . htmlspecialchars($arf) . "'>";
+ //echo gettext("Download");
+ //echo "</a>";
echo "</td>";
echo "</tr>";
}

0 comments on commit 110603e

Please sign in to comment.
Something went wrong with that request. Please try again.