]> git.p6c8.net - jirafeau.git/blobdiff - script.php
Work around LiteSpeed's truncation of large files
[jirafeau.git] / script.php
index 13a88b88624332efa25a62cd2b30c3d0a10d2d96..105023fcc8b7abb726f72e00efa86775d5b985be 100644 (file)
@@ -126,10 +126,17 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES)
         exit;
     }
 
+    // Check if one time download is enabled
+    if (!$cfg['one_time_download'] && isset($_POST['one_time_download'])) {
+        echo 'Error 26: One time download is disabled.';
+        exit;
+    }
+
     $res = jirafeau_upload($_FILES['file'],
-                            isset($_POST['one_time_download']),
-                            $key, $time, get_ip_address($cfg),
-                            $cfg['enable_crypt'], $cfg['link_name_length']);
+                           isset($_POST['one_time_download']),
+                           $key, $time, get_ip_address($cfg),
+                           $cfg['enable_crypt'], $cfg['link_name_length'],
+                           $cfg['file_hash']);
 
     if (empty($res) || $res['error']['has_error']) {
         echo 'Error 6 ' . $res['error']['why'];
@@ -408,6 +415,12 @@ elseif (isset($_GET['init_async'])) {
         $key = $_POST['key'];
     }
 
+    // Check if one time download is enabled
+    if (!$cfg['one_time_download'] && isset($_POST['one_time_download'])) {
+        echo 'Error 26: One time download is disabled.';
+        exit;
+    }
+
     $time = time();
     if (!isset($_POST['time']) || !$cfg['availabilities'][$_POST['time']]) {
         echo 'Error 22';
@@ -466,7 +479,7 @@ elseif (isset($_GET['end_async'])) {
         || !isset($_POST['code'])) {
         echo 'Error 24';
     } else {
-        echo jirafeau_async_end($_POST['ref'], $_POST['code'], $cfg['enable_crypt'], $cfg['link_name_length']);
+        echo jirafeau_async_end($_POST['ref'], $_POST['code'], $cfg['enable_crypt'], $cfg['link_name_length'], $cfg['file_hash']);
     }
 } else {
     echo 'Error 25';

patrick-canterino.de