X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/8d85f9772ae53ce6a1902a967205f8ff1a290795..0a5462c3311b4541a858b8e719ae8548877c7a62:/script.php diff --git a/script.php b/script.php index 9bf9578..7d5e25c 100755 --- a/script.php +++ b/script.php @@ -250,6 +250,13 @@ if ($_SERVER['REQUEST_METHOD'] == "GET" && count ($_GET) == 0) /* Lets use interface now. */ header('Content-Type: text; charset=utf-8'); +check_errors (); +if (has_error ()) +{ + echo "Error"; + exit; +} + /* Upload file */ if (isset ($_FILES['file']) && is_writable (VAR_FILES) && is_writable (VAR_LINKS)) @@ -285,7 +292,8 @@ if (isset ($_FILES['file']) && is_writable (VAR_FILES) } $res = jirafeau_upload ($_FILES['file'], isset ($_POST['one_time_download']), - $key, $time, $_SERVER['REMOTE_ADDR']); + $key, $time, $_SERVER['REMOTE_ADDR'], + $cfg['enable_crypt']); if (empty($res) || $res['error']['has_error']) { @@ -294,9 +302,12 @@ if (isset ($_FILES['file']) && is_writable (VAR_FILES) } /* Print direct link. */ echo $res['link']; - echo NL; /* Print delete link. */ + echo NL; echo $res['delete_link']; + /* Print decrypt key. */ + echo NL; + echo urlencode($res['crypt_key']); } elseif (isset ($_GET['h'])) { @@ -573,7 +584,7 @@ elseif (isset ($_GET['end_async'])) || !isset ($_POST['code'])) echo "Error"; else - echo jirafeau_async_end ($_POST['ref'], $_POST['code']); + echo jirafeau_async_end ($_POST['ref'], $_POST['code'], $cfg['enable_crypt']); } /* Initialize block. */ elseif (isset ($_GET['init_block']) && $cfg['enable_blocks'])