From 3afa555801644361d09aaa55951b858e1d204645 Mon Sep 17 00:00:00 2001 From: Vicent Fernandez i Capilla Date: Wed, 1 Jun 2016 13:47:33 +0200 Subject: [PATCH 01/17] Catalan translation added --- index.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/index.php b/index.php index 9894662..ef1d808 100644 --- a/index.php +++ b/index.php @@ -341,6 +341,25 @@ "del" => "Изтриване", "log_out" => "Изход" ); +//Catalan +$_TRANSLATIONS["ca"] = array( + "file_name" => "Nom d'arxiu", + "size" => "Mida", + "last_changed" => "Última modificació", + "total_used_space" => "Total espai emprat", + "free_space" => "Espai lliure", + "password" => "Paraula de pass", + "upload" => "Pujar arxiu", + "failed_upload" => "Error al pujar l'arxiu!", + "failed_move" => "Error al moure l'arxiu al directori seleccionat!", + "wrong_password" => "Paraula de pas incorrecta", + "make_directory" => "Crear directori", + "new_dir_failed" => "Error al crear el directori", + "chmod_dir_failed" => "Error al canviar els permisos del directori", + "unable_to_read_dir" => "No es possible llegir el directori", + "location" => "Traducció", + "root" => "Arrel" +); // Czech $_TRANSLATIONS["cz"] = array( From ec5b1e0c0ebd20dd5df3edfa17ed3908efabbb63 Mon Sep 17 00:00:00 2001 From: ChriZathens Date: Thu, 3 Nov 2016 15:22:09 +0200 Subject: [PATCH 02/17] Update Greek translation added missing strings --- index.php | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index ef1d808..169fc3f 100644 --- a/index.php +++ b/index.php @@ -577,20 +577,33 @@ $_TRANSLATIONS["el"] = array( "file_name" => "Όνομα αρχείου", "size" => "Μέγεθος", - "last_changed" => "Τροποποιημένο", + "last_changed" => "Τελευταία τροποποίηση", "total_used_space" => "Χρησιμοποιημένος χώρος", "free_space" => "Ελεύθερος χώρος", - "password" => "Εισάγεται κωδικό", + "password" => "Κωδικός", "upload" => "Φόρτωση", "failed_upload" => "Αποτυχία φόρτωσης αρχείου!", "failed_move" => "Αποτυχία μεταφοράς αρχείου στον κατάλληλο φάκελο!", "wrong_password" => "Λάθος κωδικός", - "make_directory" => "Δημιουργία νέου φακέλου", - "new_dir_failed" => "Αποτυχία δημιουργίας νέου φακέλου", + "make_directory" => "Νέος Φάκελος", + "new_dir_failed" => "Αποτυχία δημιουργίας φακέλου", "chmod_dir_failed" => "Αποτυχία τροποποίησης δικαιωμάτων φακέλου", - "unable_to_read_dir" => "Unable to read directory", - "location" => "Location", - "root" => "Root" + "unable_to_read_dir" => "Αδυναμία ανάγνωσης φακέλου", + "location" => "Τοποθεσία", + "root" => "Ριζικός φάκελος", + "log_file_permission_error" => "Το πρόγραμμα δεν έχει δικαιώματα εγγραφής στο αρχείο καταγραφής.", + "upload_not_allowed" => "Οι ρυθμίσεις του προγράμματος δεν επιτρέπουν φόρτωση αρχείων σε αυτό τον φάκελο.", + "upload_dir_not_writable" => "Αυτός ο φάκελος δεν έχει δικαιώματα για εγγραφή.", + "mobile_version" => "Φορητή προβολή", + "standard_version" => "Στάνταρ προβολή", + "page_load_time" => "Η σελίδα φόρτωσε σε %.2f ms", + "wrong_pass" => "Λάθος όνομα χρήστη ή κωδικός", + "username" => "Όνομα χρήστη", + "log_in" => "Σύνδεση", + "upload_type_not_allowed" => "Αυτός ο τύπος αρχείου δεν επιτρέπεται να φορτωθεί.", + "del" => "Διαγραφή", + "log_out" => "Αποσύνδεση" + ); // Spanish From 310ff8c3966097caadcfba37595a3d0af24b255c Mon Sep 17 00:00:00 2001 From: Taz8du29 Date: Sat, 26 Nov 2016 21:45:35 +0100 Subject: [PATCH 03/17] French translation update Corrected some translations Added html codes for accents --- index.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/index.php b/index.php index ef1d808..a237733 100644 --- a/index.php +++ b/index.php @@ -513,32 +513,32 @@ $_TRANSLATIONS["fr"] = array( "file_name" => "Nom de fichier", "size" => "Taille", - "last_changed" => "Ajouté", - "total_used_space" => "Espace total utilisé", + "last_changed" => "Modifié le", + "total_used_space" => "Espace total utilisé", "free_space" => "Espace libre", "password" => "Mot de passe", - "upload" => "Envoyer un fichier", + "upload" => "Ajouter", "failed_upload" => "Erreur lors de l'envoi", - "failed_move" => "Erreur lors du changement de dossier", + "failed_move" => "Erreur lors du déplacement", "wrong_password" => "Mauvais mot de passe", "make_directory" => "Nouveau dossier", - "new_dir_failed" => "Erreur lors de la création du dossier", + "new_dir_failed" => "Erreur lors de la création du dossier", "chmod_dir_failed" => "Impossible de changer les permissions du dossier", "unable_to_read_dir" => "Impossible de lire le dossier", "location" => "Localisation", "root" => "Racine", - "log_file_permission_error" => "Le script ne possède pas les permissions pour écrire un fichier d'enregistrement.", - "upload_not_allowed" => "La configuration actuelle ne permet de déposer un fichier dans ce dossier.", - "upload_dir_not_writable" => "Ce dossier ne possède pas les permissions en écriture.", - "mobile_version" => "Vue mobile", - "standard_version" => "Vue standard", + "log_file_permission_error" => "Le script n'a pas la permission d'écrire dans le fichier de logs.", + "upload_not_allowed" => "La configuration du script ne permet pas d'ajouter un fichier ici.", + "upload_dir_not_writable" => "Ce dossier ne possède pas de permission en écriture.", + "mobile_version" => "Version mobile", + "standard_version" => "Version standard", "page_load_time" => "Page chargée en %.2f ms", - "wrong_pass" => "Identifiant ou mot de passe incorrect", + "wrong_pass" => "Mauvais identifiant ou mot de passe", "username" => "Identifiant", "log_in" => "Connexion", - "upload_type_not_allowed" => "Ce format de fichier n'est pas autorisé.", - "del" => "Effacer", - "log_out" => "Déconnexion" + "upload_type_not_allowed" => "L'envoi de ce type de fichier n'est pas permis.", + "del" => "Supprimer", + "log_out" => "Déconnexion" ); // German From 187a9413125859e4b234e3723bd04b2b14ab6adf Mon Sep 17 00:00:00 2001 From: Taz8du29 Date: Sat, 26 Nov 2016 21:53:24 +0100 Subject: [PATCH 04/17] Updated French translation Corrected wrong pass(word) vars. Both have same string for security reasons : bruteforcer can't know if he hit the right username (must be done for all the project. //Todo) --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index a237733..fa9dea5 100644 --- a/index.php +++ b/index.php @@ -520,7 +520,7 @@ "upload" => "Ajouter", "failed_upload" => "Erreur lors de l'envoi", "failed_move" => "Erreur lors du déplacement", - "wrong_password" => "Mauvais mot de passe", + "wrong_password" => "Identifiant ou mot de passe incorrect", "make_directory" => "Nouveau dossier", "new_dir_failed" => "Erreur lors de la création du dossier", "chmod_dir_failed" => "Impossible de changer les permissions du dossier", @@ -533,7 +533,7 @@ "mobile_version" => "Version mobile", "standard_version" => "Version standard", "page_load_time" => "Page chargée en %.2f ms", - "wrong_pass" => "Mauvais identifiant ou mot de passe", + "wrong_pass" => "Identifiant ou mot de passe incorrect", "username" => "Identifiant", "log_in" => "Connexion", "upload_type_not_allowed" => "L'envoi de ce type de fichier n'est pas permis.", From 043827f8a4ec2c0cdfb4fc203b403089869d088b Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Mon, 5 Mar 2018 17:26:26 +0000 Subject: [PATCH 05/17] Updated readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e77d265..f40a973 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,11 @@ it is kept simple and functional. Free for everyone. * Interface for mobile devices +Looking for a new manager +---------------------------------- +Updated 5 March 2018: I am currently busy with other projects and therefore unable to continue updating encode explorer. Since the project is still quite popular, I am looking for someone to take over the maintenance and development of this code. This person should be someone with an established github history of contributing to open-source PHP projects. If you are interested, contact me at marek.rei@gmail.com. + + Manual ---------------------------------- You have to upload index.php into your server. From 13f8ca115355f17889127634ff35df441ca963ea Mon Sep 17 00:00:00 2001 From: JonnyTech Date: Mon, 11 Mar 2019 00:59:22 +0000 Subject: [PATCH 06/17] Make links downloadable Add an option to make file links downloadable by using the HTML `download` attribute (https://www.w3schools.com/TAGS/att_a_download.asp) --- index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index a2ffe79..987b294 100644 --- a/index.php +++ b/index.php @@ -73,6 +73,12 @@ // $_CONFIG['open_in_new_window'] = false; +// +// Will the files be downloaded rather than opened? true/false +// Default: $_CONFIG['force_download'] = false; +// +$_CONFIG['force_download'] = false; + // // How deep in subfolders will the script search for files? // Set it larger than 0 to display the total used space. @@ -3169,7 +3175,10 @@ function(){ print " class=\"item file"; if($file->isValidForThumb()) print " thumb"; - print "\">"; + print "\""; + if(EncodeExplorer::getConfig('force_download') == true) + print " download"; + print ">"; print $file->getNameHtml(); if($this->mobile == true) { From 140a178388ca9e405ecf88a55c2f9a6ef6817da7 Mon Sep 17 00:00:00 2001 From: ChriZathens Date: Thu, 11 Apr 2019 10:18:41 +0300 Subject: [PATCH 07/17] Greek language minor fixes --- index.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index a2ffe79..3706989 100644 --- a/index.php +++ b/index.php @@ -595,9 +595,9 @@ "upload_not_allowed" => "Οι ρυθμίσεις του προγράμματος δεν επιτρέπουν φόρτωση αρχείων σε αυτό τον φάκελο.", "upload_dir_not_writable" => "Αυτός ο φάκελος δεν έχει δικαιώματα για εγγραφή.", "mobile_version" => "Φορητή προβολή", - "standard_version" => "Στάνταρ προβολή", - "page_load_time" => "Η σελίδα φόρτωσε σε %.2f ms", - "wrong_pass" => "Λάθος όνομα χρήστη ή κωδικός", + "standard_version" => "Τυπική προβολή", + "page_load_time" => "Η σελίδα φορτώθηκε σε %.2f ms", + "wrong_pass" => "Λάθος όνομα χρήστη ή κωδικός πρόσβασης", "username" => "Όνομα χρήστη", "log_in" => "Σύνδεση", "upload_type_not_allowed" => "Αυτός ο τύπος αρχείου δεν επιτρέπεται να φορτωθεί.", From fce9d1b513a03984b1083d7ca736d4483f86a97c Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 31 Dec 2019 17:09:08 +0200 Subject: [PATCH 08/17] Translations for Lituanian added --- index.php | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/index.php b/index.php index a2ffe79..4a949f0 100644 --- a/index.php +++ b/index.php @@ -764,6 +764,38 @@ "log_out" => "로그아웃" ); +// Lithuanian +$_TRANSLATIONS["lt"] = array( + "file_name" => "Pavadinimas", + "size" => "Dydis", + "last_changed" => "Paskutiniai pakeitimai", + "total_used_space" => "Visa naudojama vieta", + "free_space" => "Laisva vieta", + "password" => "Slaptažodis", + "upload" => "Įkelti", + "failed_upload" => "Įkėlimas nepavyko", + "failed_move" => "Failo perkėlimas nepavyko", + "wrong_password" => "Klaidingas slaptažodis", + "make_directory" => "Kurti aplanką", + "new_dir_failed" => "Aplanko sukurti nepavyko", + "chmod_dir_failed" => "Privilegijų keitimas nepavyko", + "unable_to_read_dir" => "Nepavyko atverti aplanko", + "location" => "Vieta", + "root" => "Šakninis", + "log_file_permission_error" => "Šis skriptas neturi teisių rašyti log failo.", + "upload_not_allowed" => "Šis skriptas neleidžia failų įklimo į šį aplanką.", + "upload_dir_not_writable" => "Neturite teisių rašyti į šį aplanką.", + "mobile_version" => "Versija mobiliesiems", + "standard_version" => "Paprasta versija", + "page_load_time" => "Puslapis įkeltas per %.2f ms", + "wrong_pass" => "Klaidingas vartotojo vardas ar slaptažodis", + "username" => "Vartotojo vardas", + "log_in" => "Prisijungti", + "upload_type_not_allowed" => "Šio tipo failų įkelti negalima.", + "del" => "Trinti", // short for Delete + "log_out" => "Atsijungti" +); + // Norwegian $_TRANSLATIONS["no"] = array( "file_name" => "Navn", From a68bcaa7b4fa10557b463ffb5d39f286ade38c16 Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Wed, 3 Jan 2024 19:07:39 +0000 Subject: [PATCH 09/17] Removed call to get_magic_quotes_gpc as it is not deprecated --- index.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.php b/index.php index a2ffe79..16bb92b 100644 --- a/index.php +++ b/index.php @@ -2163,8 +2163,6 @@ function uploadFile($location, $userfile) { global $encodeExplorer; $name = basename($userfile['name']); - if(get_magic_quotes_gpc()) - $name = stripslashes($name); $upload_dir = $location->getFullPath(); $upload_file = $upload_dir . $name; From 24545483f8df13e6690e2c35c6eb1f5454be9f90 Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Wed, 3 Jan 2024 20:01:07 +0000 Subject: [PATCH 10/17] Changing documentation message for force downloading --- index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 8e5407b..00aee3f 100644 --- a/index.php +++ b/index.php @@ -74,7 +74,7 @@ $_CONFIG['open_in_new_window'] = false; // -// Will the files be downloaded rather than opened? true/false +// When clicking on files, will the files be downloaded rather than opened? true/false // Default: $_CONFIG['force_download'] = false; // $_CONFIG['force_download'] = false; @@ -3206,6 +3206,7 @@ function(){ if($file->isValidForThumb()) print " thumb"; print "\""; + print "WOOOO".EncodeExplorer::getConfig('force_download'); if(EncodeExplorer::getConfig('force_download') == true) print " download"; print ">"; From 7c9d58d873195836d9d7ab6610591a7fe352cb1a Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Wed, 3 Jan 2024 20:01:33 +0000 Subject: [PATCH 11/17] Switching to natural comparison when comparing strings --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 00aee3f..aebe042 100644 --- a/index.php +++ b/index.php @@ -2877,7 +2877,7 @@ function debug() public static function cmp_name($a, $b) { - return strcasecmp($a->name, $b->name); + return strnatcmp($a->name, $b->name); } public static function cmp_size($a, $b) From c59b3ece4a0e7546202c0083cb83d10f9e2f622c Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Wed, 3 Jan 2024 20:03:05 +0000 Subject: [PATCH 12/17] Switching to natural case-insensitive comparison when comparing strings --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index aebe042..6b3d99e 100644 --- a/index.php +++ b/index.php @@ -2877,7 +2877,7 @@ function debug() public static function cmp_name($a, $b) { - return strnatcmp($a->name, $b->name); + return strnatcasecmp($a->name, $b->name); } public static function cmp_size($a, $b) From d0177946b73441557b1fcea43ae93a291ab059e4 Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Wed, 3 Jan 2024 20:04:41 +0000 Subject: [PATCH 13/17] Updating version to 6.4.2 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 6b3d99e..b4ff451 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ * Encode Explorer * * Author : Marek Rei (marek ät marekrei dot com) - * Version : 6.4.1 + * Version : 6.4.2 * Homepage : encode-explorer.siineiolekala.net * * From 1807c611ddc4425249c5dfa88467d9fc85fcd4be Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Wed, 3 Jan 2024 20:09:20 +0000 Subject: [PATCH 14/17] Updating readme --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index f40a973..79f917f 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,6 @@ it is kept simple and functional. Free for everyone. * Interface for mobile devices -Looking for a new manager ----------------------------------- -Updated 5 March 2018: I am currently busy with other projects and therefore unable to continue updating encode explorer. Since the project is still quite popular, I am looking for someone to take over the maintenance and development of this code. This person should be someone with an established github history of contributing to open-source PHP projects. If you are interested, contact me at marek.rei@gmail.com. - - Manual ---------------------------------- You have to upload index.php into your server. @@ -30,7 +25,7 @@ License ---------------------------------- This software is distributed under The MIT License (MIT). -Copyright (c) 2015 Marek Rei +Copyright (c) 2023 Marek Rei Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 50dc54e60f81ae7c452d2afd3609852c30fb7fc4 Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Mon, 2 Dec 2024 16:23:07 +0000 Subject: [PATCH 15/17] Adding check for thumbnail location --- index.php | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/index.php b/index.php index b4ff451..7a361bf 100644 --- a/index.php +++ b/index.php @@ -1828,6 +1828,9 @@ public static function openPdf($file) if(!ImageServer::isEnabledPdf()) return null; + if(!ImageServer::isAllowedToOpenPath($file)) + return null; + $im = new Imagick($file.'[0]'); $im->setImageFormat( "png" ); $str = $im->getImageBlob(); @@ -1915,30 +1918,42 @@ public static function showThumbnail($file) imagepng($image); } } + + public static function isAllowedToOpenPath($file) + { + if(realpath($file) && str_starts_with(realpath($file), realpath($_CONFIG['starting_dir']))) + return true; + return false; + } // // A helping function for opening different types of image files // public static function openImage ($file) { - $size = getimagesize($file); - switch($size["mime"]) - { - case "image/jpeg": - $im = imagecreatefromjpeg($file); - break; - case "image/gif": - $im = imagecreatefromgif($file); - break; - case "image/png": - $im = imagecreatefrompng($file); - break; - default: - $im=null; - break; - } + if(!ImageServer::isAllowedToOpenPath($file)) + return null; + + $im = null; + $size = getimagesize($file); + switch($size["mime"]) + { + case "image/jpeg": + $im = imagecreatefromjpeg($file); + break; + case "image/gif": + $im = imagecreatefromgif($file); + break; + case "image/png": + $im = imagecreatefrompng($file); + break; + default: + $im = null; + break; + } return $im; } + } // @@ -3206,7 +3221,7 @@ function(){ if($file->isValidForThumb()) print " thumb"; print "\""; - print "WOOOO".EncodeExplorer::getConfig('force_download'); + print " ".EncodeExplorer::getConfig('force_download'); if(EncodeExplorer::getConfig('force_download') == true) print " download"; print ">"; From 2ac09083190a11d28c27183aa7ef63914bb6093a Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Mon, 2 Dec 2024 16:33:05 +0000 Subject: [PATCH 16/17] Fixing missing global config variable --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index 7a361bf..65c7466 100644 --- a/index.php +++ b/index.php @@ -1921,6 +1921,7 @@ public static function showThumbnail($file) public static function isAllowedToOpenPath($file) { + global $_CONFIG; if(realpath($file) && str_starts_with(realpath($file), realpath($_CONFIG['starting_dir']))) return true; return false; From 8fd2ed692dd6dcbd7992d09faf1605021f8eb1bb Mon Sep 17 00:00:00 2001 From: Marek Rei Date: Tue, 3 Dec 2024 01:27:52 +0000 Subject: [PATCH 17/17] Fixing whitespace differences --- index.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index 65c7466..01b732d 100644 --- a/index.php +++ b/index.php @@ -1828,8 +1828,8 @@ public static function openPdf($file) if(!ImageServer::isEnabledPdf()) return null; - if(!ImageServer::isAllowedToOpenPath($file)) - return null; + if(!ImageServer::isAllowedToOpenPath($file)) + return null; $im = new Imagick($file.'[0]'); $im->setImageFormat( "png" ); @@ -1921,10 +1921,10 @@ public static function showThumbnail($file) public static function isAllowedToOpenPath($file) { - global $_CONFIG; - if(realpath($file) && str_starts_with(realpath($file), realpath($_CONFIG['starting_dir']))) - return true; - return false; + global $_CONFIG; + if(realpath($file) && str_starts_with(realpath($file), realpath($_CONFIG['starting_dir']))) + return true; + return false; } // @@ -1933,8 +1933,8 @@ public static function isAllowedToOpenPath($file) public static function openImage ($file) { if(!ImageServer::isAllowedToOpenPath($file)) - return null; - + return null; + $im = null; $size = getimagesize($file); switch($size["mime"])