mirror of
https://gitlab.com/mojo42/Jirafeau.git
synced 2025-01-17 12:58:20 +01:00
Work around LiteSpeed's truncation of large files
This commit is contained in:
parent
208418c2e0
commit
41cde93bc1
16
f.php
16
f.php
@ -241,9 +241,21 @@ header('Content-Type: ' . $link['mime_type']);
|
||||
if ($cfg['file_hash'] == "md5") {
|
||||
header('Content-MD5: ' . hex_to_base64($link['hash']));
|
||||
}
|
||||
|
||||
if ($cfg['litespeed_workaround']) {
|
||||
// Work around that LiteSpeed truncates large files.
|
||||
// See https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:config:internal-redirect
|
||||
if ($_GET['litespeed_workaround'] == 'phase2') {
|
||||
$file_web_path = preg_replace('#^' . $_SERVER['DOCUMENT_ROOT'] . '#', '', VAR_FILES);
|
||||
header('X-LiteSpeed-Location: ' . $file_web_path . $p . $link['hash']);
|
||||
} else {
|
||||
// Since Content-Type isn't forwarded by LiteSpeed, first
|
||||
// redirect to the same URL but append the file name.
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '/' . $link['file_name'] . '?' .
|
||||
$_SERVER['QUERY_STRING'] . '&litespeed_workaround=phase2');
|
||||
}
|
||||
}
|
||||
/* Read encrypted file. */
|
||||
if ($link['crypted']) {
|
||||
else if ($link['crypted']) {
|
||||
/* Init module */
|
||||
$m = mcrypt_module_open('rijndael-256', '', 'ofb', '');
|
||||
/* Extract key and iv. */
|
||||
|
@ -163,6 +163,19 @@ $cfg['proxy_ip'] = array();
|
||||
*/
|
||||
$cfg['file_hash'] = 'md5';
|
||||
|
||||
/* Work around that LiteSpeed truncates large files when downloading.
|
||||
* Only for use with the LiteSpeed web server!
|
||||
* An internal redirect is made using X-LiteSpeed-Location instead
|
||||
* of streaming the file from PHP.
|
||||
* Limitations:
|
||||
* - The Jirafeau files folder has to be placed under the document root and should be
|
||||
* protected from unauthorized access using rewrite rules.
|
||||
* See https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:config:internal-redirect#protection_from_direct_access
|
||||
* - Incompatible with server side encryption.
|
||||
* - Incompatible with one time download.
|
||||
*/
|
||||
$cfg['litespeed_workaround'] = false;
|
||||
|
||||
/* Required flag to test if the installation is already installed
|
||||
* or needs to start the installation script
|
||||
*/
|
||||
|
@ -569,6 +569,14 @@ function check_errors($cfg)
|
||||
if (!is_writable(VAR_ASYNC)) {
|
||||
add_error(t('ASYNC_DIR_W'), VAR_ASYNC);
|
||||
}
|
||||
|
||||
if ($cfg['enable_crypt'] && $cfg['litespeed_workaround']) {
|
||||
add_error(t('INCOMPATIBLE_OPTIONS_W'), 'enable_crypt=true<br>litespeed_workaround=true');
|
||||
}
|
||||
|
||||
if ($cfg['one_time_download'] && $cfg['litespeed_workaround']) {
|
||||
add_error(t('INCOMPATIBLE_OPTIONS_W'), 'one_time_download=true<br>litespeed_workaround=true');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "قد لا يدعم متصفحك HTML5، لذا فإن الحد الأقصى لحجم الملف هو ",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "الدخول محظور",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Ваш браўзер не падтрымлівае HTML5, таму максімальны памер файла ",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "Jirafeau — ваша вэб-сховішча файлаў",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "আপনার ব্রাউজার HTML5 সমর্থন নাও করতে পারে, তাই সর্বোচ্চ ফাইলের আকার ",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "El teu navegador no és compatible amb HTML5, per tant, la mida màxima del fitxers és ",
|
||||
"PLURAL_ENDING": "s",
|
||||
"JI_WEB_RE": "Jirafeau, el teu repositori web de fitxers",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Váš prohlížeč nepodporuje HTML5, proto je maximílní velikost souboru ",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Přístup zamítnut",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Ihr Browser unterstützt möglicherweise kein HTML5, demnach beträgt die maximale Dateigröße ",
|
||||
"PLURAL_ENDING": "n",
|
||||
"ACCESS_KO": "Zugriff verweigert",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "Χώρος αποθήκευσης των διαδικτυακών σας αρχείων",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "The following configuration options are incompatible:",
|
||||
"NO_BROWSER_SUPPORT": "Your browser may not support HTML5, so the maximum file size is ",
|
||||
"PLURAL_ENDING": "s",
|
||||
"JI_WEB_RE": "Jirafeau, your web file repository",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Tu navegador puede no soportar HTML5, debido a esto el tamaño máximo de archivo es ",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Acceso denegado",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Pääsy estetty",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Votre navigateur ne supporte apparemment pas HTML5, la taille maximale de fichier téléchargable est de ",
|
||||
"PLURAL_ENDING": "s",
|
||||
"ACCESS_KO": "Accès interdit",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "Jirafeau , אתר הקבצים שלך",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "Jirafeau, Vaše mrežno skladište datoteka",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Hozzáférés megtagadva",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Il tuo browser potrebbe non supportare HTML5, quindi la dimensione massima del file è ",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Accesso negato",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "Jirafeau, web filibus depositum tuum",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Det kan hende at nettleseren din ikke støtter HTML5, så største tillatte filstørrelse er ",
|
||||
"PLURAL_ENDING": "er",
|
||||
"JI_WEB_RE": "Jirafeau, din vevfilpakkebrønn",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Toegang geweigerd",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "Jirafeau, twoje internetowe repozytorium plików",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"NO_BROWSER_SUPPORT": "O seu navegador pode não suportar HTML5, então o tamanho máximo do ficheiro é ",
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"PLURAL_ENDING": "s",
|
||||
"ACCESS_KO": "Acesso negado",
|
||||
"ACTION": "Acção",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Seu navegador pode não suportar HTML5, portanto, o tamanho máximo do arquivo é ",
|
||||
"PLURAL_ENDING": "s",
|
||||
"JI_WEB_RE": "Jirafeau, o seu repositório web de arquivos",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Acces refuzat",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Доступ запрещён",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Zdá sa, že Váš prehliadač nepodporuje HTML5. Maximálna veľkosť súboru je preto obmedzená na ",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Prístup odoprený",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "Приступ одбијен",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "Följande inställningar är inkompatibla:",
|
||||
"NO_BROWSER_SUPPORT": "Din webbläsare verkar inte stödja HTML5, så max filstorlek är ",
|
||||
"PLURAL_ENDING": "er",
|
||||
"JI_WEB_RE": "Jirafeau, ditt filutrymme på nätet",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"JI_WEB_RE": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "Tarayıcınız HTML5'i desteklemeyebilir, bu nedenle en fazla dosya boyutu ",
|
||||
"PLURAL_ENDING": "sn",
|
||||
"JI_WEB_RE": "Jirafeau, web dosya deponuz",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "",
|
||||
"PLURAL_ENDING": "",
|
||||
"ACCESS_KO": "",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "您的浏览器可能不支持 HTML5,因此文件最大为 ",
|
||||
"PLURAL_ENDING": "s",
|
||||
"ACCESS_KO": "拒绝访问",
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"INCOMPATIBLE_OPTIONS_W": "",
|
||||
"NO_BROWSER_SUPPORT": "您的瀏覽器可能不支持 HTML5,因此文件最大為 ",
|
||||
"PLURAL_ENDING": "s",
|
||||
"ACCESS_KO": "拒絕訪問",
|
||||
|
Loading…
x
Reference in New Issue
Block a user