Completed
Push — master ( 5061b6...54eaec )
by Michael
12:20 queued 12:16
created
class/xoopseditor/tinymce4/external_plugins/filemanager/lang/pt_PT.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -1,74 +1,74 @@
 block discarded – undo
1 1
 <?php
2
-define('lang_Select','Seleccionar');
3
-define('lang_Erase','Eliminar');
4
-define('lang_Open','Abrir');
5
-define('lang_Confirm_del','Tem certeza que pretende eliminar este arquivo?');
6
-define('lang_All','Todos');
7
-define('lang_Files','Ficheiros');
8
-define('lang_Images','Imagens');
9
-define('lang_Archives','Compactados');
10
-define('lang_Error_Upload','O ficheiro enviado é maior que o limite permitido.');
11
-define('lang_Error_extension','Extensão não permitida.');
12
-define('lang_Upload_file','Carregar ficheiro');
13
-define('lang_Filters','Filtro');
14
-define('lang_Videos','Vídeos');
15
-define('lang_Music','Música');
16
-define('lang_New_Folder','Nova pasta');
17
-define('lang_Folder_Created','Pasta criada com sucesso');
18
-define('lang_Existing_Folder','Pasta existente');
19
-define('lang_Confirm_Folder_del','Tem certeza que pretende eliminar a pasta e todo o seu conteúdo?');
20
-define('lang_Return_Files_List','Voltar à lista de ficheiros');
21
-define('lang_Preview','Pré-visualizar');
22
-define('lang_Download','Descarregar');
23
-define('lang_Insert_Folder_Name','Insira o nome da pasta:');
24
-define('lang_Root','root');
25
-define('lang_Rename','Mudar o nome');
26
-define('lang_Back','de volta');
27
-define('lang_View','View');
28
-define('lang_View_list','List view');
29
-define('lang_View_columns_list','Columns list view');
30
-define('lang_View_boxes','Box view');
31
-define('lang_Toolbar','Toolbar');
32
-define('lang_Actions','Actions');
33
-define('lang_Rename_existing_file','The file is already existing');
34
-define('lang_Rename_existing_folder','The folder is already existing');
35
-define('lang_Empty_name','The name is empty');
36
-define('lang_Text_filter','text filter');
37
-define('lang_Swipe_help','Swipe the name of file/folder to show options');
38
-define('lang_Upload_base','Base upload');
39
-define('lang_Upload_java','JAVA upload (big size files)');
40
-define('lang_Upload_java_help',"If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall");
41
-define('lang_Upload_base_help',"Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button.");
42
-define('lang_Type_dir','dir');
43
-define('lang_Type','Type');
44
-define('lang_Dimension','Dimension');
45
-define('lang_Size','Size');
46
-define('lang_Date','Date');
47
-define('lang_Filename','Name');
48
-define('lang_Operations','Operations');
49
-define('lang_Date_type','y-m-d');
50
-define('lang_OK','OK');
51
-define('lang_Cancel','Cancel');
52
-define('lang_Sorting','sorting');
53
-define('lang_Show_url','show URL');
54
-define('lang_Extract','extract here');
55
-define('lang_File_info','file info');
56
-define('lang_Edit_image','edit image');
57
-define('lang_Duplicate','Duplicate');
2
+define('lang_Select', 'Seleccionar');
3
+define('lang_Erase', 'Eliminar');
4
+define('lang_Open', 'Abrir');
5
+define('lang_Confirm_del', 'Tem certeza que pretende eliminar este arquivo?');
6
+define('lang_All', 'Todos');
7
+define('lang_Files', 'Ficheiros');
8
+define('lang_Images', 'Imagens');
9
+define('lang_Archives', 'Compactados');
10
+define('lang_Error_Upload', 'O ficheiro enviado é maior que o limite permitido.');
11
+define('lang_Error_extension', 'Extensão não permitida.');
12
+define('lang_Upload_file', 'Carregar ficheiro');
13
+define('lang_Filters', 'Filtro');
14
+define('lang_Videos', 'Vídeos');
15
+define('lang_Music', 'Música');
16
+define('lang_New_Folder', 'Nova pasta');
17
+define('lang_Folder_Created', 'Pasta criada com sucesso');
18
+define('lang_Existing_Folder', 'Pasta existente');
19
+define('lang_Confirm_Folder_del', 'Tem certeza que pretende eliminar a pasta e todo o seu conteúdo?');
20
+define('lang_Return_Files_List', 'Voltar à lista de ficheiros');
21
+define('lang_Preview', 'Pré-visualizar');
22
+define('lang_Download', 'Descarregar');
23
+define('lang_Insert_Folder_Name', 'Insira o nome da pasta:');
24
+define('lang_Root', 'root');
25
+define('lang_Rename', 'Mudar o nome');
26
+define('lang_Back', 'de volta');
27
+define('lang_View', 'View');
28
+define('lang_View_list', 'List view');
29
+define('lang_View_columns_list', 'Columns list view');
30
+define('lang_View_boxes', 'Box view');
31
+define('lang_Toolbar', 'Toolbar');
32
+define('lang_Actions', 'Actions');
33
+define('lang_Rename_existing_file', 'The file is already existing');
34
+define('lang_Rename_existing_folder', 'The folder is already existing');
35
+define('lang_Empty_name', 'The name is empty');
36
+define('lang_Text_filter', 'text filter');
37
+define('lang_Swipe_help', 'Swipe the name of file/folder to show options');
38
+define('lang_Upload_base', 'Base upload');
39
+define('lang_Upload_java', 'JAVA upload (big size files)');
40
+define('lang_Upload_java_help', "If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall");
41
+define('lang_Upload_base_help', "Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button.");
42
+define('lang_Type_dir', 'dir');
43
+define('lang_Type', 'Type');
44
+define('lang_Dimension', 'Dimension');
45
+define('lang_Size', 'Size');
46
+define('lang_Date', 'Date');
47
+define('lang_Filename', 'Name');
48
+define('lang_Operations', 'Operations');
49
+define('lang_Date_type', 'y-m-d');
50
+define('lang_OK', 'OK');
51
+define('lang_Cancel', 'Cancel');
52
+define('lang_Sorting', 'sorting');
53
+define('lang_Show_url', 'show URL');
54
+define('lang_Extract', 'extract here');
55
+define('lang_File_info', 'file info');
56
+define('lang_Edit_image', 'edit image');
57
+define('lang_Duplicate', 'Duplicate');
58 58
 define('lang_Folders', 'Folders');
59
-define('lang_Copy','Copy');
60
-define('lang_Cut','Cut');
61
-define('lang_Paste','Paste');
59
+define('lang_Copy', 'Copy');
60
+define('lang_Cut', 'Cut');
61
+define('lang_Paste', 'Paste');
62 62
 define('lang_CB', 'CB'); // clipboard
63
-define('lang_Paste_Here','Paste to this directory');
64
-define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.');
65
-define('lang_Paste_Failed','Failed to paste file(s)');
66
-define('lang_Clear_Clipboard','Clear clipboard');
67
-define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?');
68
-define('lang_Files_ON_Clipboard','There are files on the clipboard.');
69
-define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy
70
-define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy
71
-define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders
63
+define('lang_Paste_Here', 'Paste to this directory');
64
+define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.');
65
+define('lang_Paste_Failed', 'Failed to paste file(s)');
66
+define('lang_Clear_Clipboard', 'Clear clipboard');
67
+define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?');
68
+define('lang_Files_ON_Clipboard', 'There are files on the clipboard.');
69
+define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy
70
+define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy
71
+define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders
72 72
 define('lang_Aviary_No_Save', 'Could not save image');
73 73
 define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.');
74 74
 define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.');
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/external_plugins/filemanager/lang/pl.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -1,74 +1,74 @@
 block discarded – undo
1 1
 <?php
2
-define('lang_Select','Wybierz');
3
-define('lang_Erase','Wyczyść');
4
-define('lang_Open','Otwórz');
5
-define('lang_Confirm_del','Czy jesteś pewien, że chcesz usunąć ten plik?');
6
-define('lang_All','Wszystkie');
7
-define('lang_Files','Pliki');
8
-define('lang_Images','Zdjęcia');
9
-define('lang_Archives','Archiwa');
10
-define('lang_Error_Upload','Plik przekracza maksymalny dozwolony rozmiar.');
11
-define('lang_Error_extension','Niedozwolone rozszerzenie pliku.');
12
-define('lang_Upload_file','Wgraj plik');
13
-define('lang_Filters','Filtr widoku');
14
-define('lang_Videos','Filmy');
15
-define('lang_Music','Muzyka');
16
-define('lang_New_Folder','Dodaj nowy folder');
17
-define('lang_Folder_Created','Folder został utworzony poprawnie');
18
-define('lang_Existing_Folder','Istniejący folder');
19
-define('lang_Confirm_Folder_del','Czy jesteś pewien, że chcesz usunąć folder i wszystko co znajduje się w nim?');
20
-define('lang_Return_Files_List','Powrót do listy plików');
21
-define('lang_Preview','Podgląd');
22
-define('lang_Download','Pobierz');
23
-define('lang_Insert_Folder_Name','Podaj nazwę folderu:');
24
-define('lang_Root','root');
25
-define('lang_Rename','Zmień nazwę');
26
-define('lang_Back','[..]');
27
-define('lang_View','Widok');
28
-define('lang_View_list','Lista');
29
-define('lang_View_columns_list','Kolumny');
30
-define('lang_View_boxes','Bloki');
31
-define('lang_Toolbar','Pasek');
32
-define('lang_Actions','Opcje');
33
-define('lang_Rename_existing_file','Ten plik już tutaj umieszczono');
34
-define('lang_Rename_existing_folder','Ten folder już tutaj utworzono');
35
-define('lang_Empty_name','Nie podano wymaganej nazwy');
36
-define('lang_Text_filter','wpisz txt');
37
-define('lang_Swipe_help','Kliknij w nazwę pliku/folderu by wyświetlić dostępne opcje');
38
-define('lang_Upload_base','Wgrywanie standardowe');
39
-define('lang_Upload_java','Wgrywanie przez skrypty JS (dla dużych plików)');
40
-define('lang_Upload_java_help',"Jeżeli ten aplet JS nie powoduje wgrywania 1. Sprawdź czy masz pobraną i uruchomioną obsługę skryptów w JAVA na stronie JAVA <a href='http://java.com/en/download/'>[pobierz]</a> 2. Upewnij się, że nie jest to blokada wynikająca z ustawień zapory firewall");
41
-define('lang_Upload_base_help',"Metoda zwana Przeciągnij & Upuść pliki w poniższy obszar, lub kliknij weń (dotyczy tylko najnowszych przeglądarek), lub wybierz plik i kliknij w przycisk. Kiedy zakończy się proces wgrywania, kliknij wyżej na przycisk by zakończyć.");
42
-define('lang_Type_dir','FLD');
43
-define('lang_Type','wg. typu');
44
-define('lang_Dimension','Wymiary');
45
-define('lang_Size','wg. wagi');
46
-define('lang_Date','wg. daty');
47
-define('lang_Filename','wg. nazwy');
48
-define('lang_Operations','Opcje');
49
-define('lang_Date_type','d-m-y');
50
-define('lang_OK','OK');
51
-define('lang_Cancel','Anuluj');
52
-define('lang_Sorting','SORTOWANIE');
53
-define('lang_Show_url','show URL');
54
-define('lang_Extract','extract here');
55
-define('lang_File_info','file info');
56
-define('lang_Edit_image','edit image');
57
-define('lang_Duplicate','Duplicate');
2
+define('lang_Select', 'Wybierz');
3
+define('lang_Erase', 'Wyczyść');
4
+define('lang_Open', 'Otwórz');
5
+define('lang_Confirm_del', 'Czy jesteś pewien, że chcesz usunąć ten plik?');
6
+define('lang_All', 'Wszystkie');
7
+define('lang_Files', 'Pliki');
8
+define('lang_Images', 'Zdjęcia');
9
+define('lang_Archives', 'Archiwa');
10
+define('lang_Error_Upload', 'Plik przekracza maksymalny dozwolony rozmiar.');
11
+define('lang_Error_extension', 'Niedozwolone rozszerzenie pliku.');
12
+define('lang_Upload_file', 'Wgraj plik');
13
+define('lang_Filters', 'Filtr widoku');
14
+define('lang_Videos', 'Filmy');
15
+define('lang_Music', 'Muzyka');
16
+define('lang_New_Folder', 'Dodaj nowy folder');
17
+define('lang_Folder_Created', 'Folder został utworzony poprawnie');
18
+define('lang_Existing_Folder', 'Istniejący folder');
19
+define('lang_Confirm_Folder_del', 'Czy jesteś pewien, że chcesz usunąć folder i wszystko co znajduje się w nim?');
20
+define('lang_Return_Files_List', 'Powrót do listy plików');
21
+define('lang_Preview', 'Podgląd');
22
+define('lang_Download', 'Pobierz');
23
+define('lang_Insert_Folder_Name', 'Podaj nazwę folderu:');
24
+define('lang_Root', 'root');
25
+define('lang_Rename', 'Zmień nazwę');
26
+define('lang_Back', '[..]');
27
+define('lang_View', 'Widok');
28
+define('lang_View_list', 'Lista');
29
+define('lang_View_columns_list', 'Kolumny');
30
+define('lang_View_boxes', 'Bloki');
31
+define('lang_Toolbar', 'Pasek');
32
+define('lang_Actions', 'Opcje');
33
+define('lang_Rename_existing_file', 'Ten plik już tutaj umieszczono');
34
+define('lang_Rename_existing_folder', 'Ten folder już tutaj utworzono');
35
+define('lang_Empty_name', 'Nie podano wymaganej nazwy');
36
+define('lang_Text_filter', 'wpisz txt');
37
+define('lang_Swipe_help', 'Kliknij w nazwę pliku/folderu by wyświetlić dostępne opcje');
38
+define('lang_Upload_base', 'Wgrywanie standardowe');
39
+define('lang_Upload_java', 'Wgrywanie przez skrypty JS (dla dużych plików)');
40
+define('lang_Upload_java_help', "Jeżeli ten aplet JS nie powoduje wgrywania 1. Sprawdź czy masz pobraną i uruchomioną obsługę skryptów w JAVA na stronie JAVA <a href='http://java.com/en/download/'>[pobierz]</a> 2. Upewnij się, że nie jest to blokada wynikająca z ustawień zapory firewall");
41
+define('lang_Upload_base_help', "Metoda zwana Przeciągnij & Upuść pliki w poniższy obszar, lub kliknij weń (dotyczy tylko najnowszych przeglądarek), lub wybierz plik i kliknij w przycisk. Kiedy zakończy się proces wgrywania, kliknij wyżej na przycisk by zakończyć.");
42
+define('lang_Type_dir', 'FLD');
43
+define('lang_Type', 'wg. typu');
44
+define('lang_Dimension', 'Wymiary');
45
+define('lang_Size', 'wg. wagi');
46
+define('lang_Date', 'wg. daty');
47
+define('lang_Filename', 'wg. nazwy');
48
+define('lang_Operations', 'Opcje');
49
+define('lang_Date_type', 'd-m-y');
50
+define('lang_OK', 'OK');
51
+define('lang_Cancel', 'Anuluj');
52
+define('lang_Sorting', 'SORTOWANIE');
53
+define('lang_Show_url', 'show URL');
54
+define('lang_Extract', 'extract here');
55
+define('lang_File_info', 'file info');
56
+define('lang_Edit_image', 'edit image');
57
+define('lang_Duplicate', 'Duplicate');
58 58
 define('lang_Folders', 'Folders');
59
-define('lang_Copy','Copy');
60
-define('lang_Cut','Cut');
61
-define('lang_Paste','Paste');
59
+define('lang_Copy', 'Copy');
60
+define('lang_Cut', 'Cut');
61
+define('lang_Paste', 'Paste');
62 62
 define('lang_CB', 'CB'); // clipboard
63
-define('lang_Paste_Here','Paste to this directory');
64
-define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.');
65
-define('lang_Paste_Failed','Failed to paste file(s)');
66
-define('lang_Clear_Clipboard','Clear clipboard');
67
-define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?');
68
-define('lang_Files_ON_Clipboard','There are files on the clipboard.');
69
-define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy
70
-define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy
71
-define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders
63
+define('lang_Paste_Here', 'Paste to this directory');
64
+define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.');
65
+define('lang_Paste_Failed', 'Failed to paste file(s)');
66
+define('lang_Clear_Clipboard', 'Clear clipboard');
67
+define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?');
68
+define('lang_Files_ON_Clipboard', 'There are files on the clipboard.');
69
+define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy
70
+define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy
71
+define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders
72 72
 define('lang_Aviary_No_Save', 'Could not save image');
73 73
 define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.');
74 74
 define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.');
Please login to merge, or discard this patch.
class/xoopseditor/tinymce4/external_plugins/filemanager/lang/bg_BG.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -1,74 +1,74 @@
 block discarded – undo
1 1
 <?php
2
-define('lang_Select','Избери');
3
-define('lang_Erase','Изтрий');
4
-define('lang_Open','Отвори');
5
-define('lang_Confirm_del','Сигурни ли сте, че искате да изтриете този файл?');
6
-define('lang_All','Всичко');
7
-define('lang_Files','Файлове');
8
-define('lang_Images','Изображения');
9
-define('lang_Archives','Архиви');
10
-define('lang_Error_Upload','Каченият файл надминава максимално разрешената големина.');
11
-define('lang_Error_extension','Това файлово разширение не е позволено.');
12
-define('lang_Upload_file','Качете файл');
13
-define('lang_Filters','Папка');
14
-define('lang_Videos','Видео');
15
-define('lang_Music','Музика');
16
-define('lang_New_Folder','Нова папка');
17
-define('lang_Folder_Created','Папката е правилно създадена');
18
-define('lang_Existing_Folder','Съществуваща папка');
19
-define('lang_Confirm_Folder_del','Сигурни ли сте, че искате да изтриете папката и всичко, което се съдържа с нея?');
20
-define('lang_Return_Files_List','Връщане към списъка с файлове');
21
-define('lang_Preview','Преглед');
22
-define('lang_Download','Свали');
23
-define('lang_Insert_Folder_Name','Въведете име на папката:');
24
-define('lang_Root','root');
25
-define('lang_Rename','Преименуване');
26
-define('lang_Back','обратно');
27
-define('lang_View','View');
28
-define('lang_View_list','List view');
29
-define('lang_View_columns_list','Columns list view');
30
-define('lang_View_boxes','Box view');
31
-define('lang_Toolbar','Toolbar');
32
-define('lang_Actions','Actions');
33
-define('lang_Rename_existing_file','The file is already existing');
34
-define('lang_Rename_existing_folder','The folder is already existing');
35
-define('lang_Empty_name','The name is empty');
36
-define('lang_Text_filter','text filter');
37
-define('lang_Swipe_help','Swipe the name of file/folder to show options');
38
-define('lang_Upload_base','Base upload');
39
-define('lang_Upload_java','JAVA upload (big size files)');
40
-define('lang_Upload_java_help',"If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall");
41
-define('lang_Upload_base_help',"Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button.");
42
-define('lang_Type_dir','dir');
43
-define('lang_Type','Type');
44
-define('lang_Dimension','Dimension');
45
-define('lang_Size','Size');
46
-define('lang_Date','Date');
47
-define('lang_Filename','Name');
48
-define('lang_Operations','Operations');
49
-define('lang_Date_type','y-m-d');
50
-define('lang_OK','OK');
51
-define('lang_Cancel','Cancel');
52
-define('lang_Sorting','sorting');
53
-define('lang_Show_url','show URL');
54
-define('lang_Extract','extract here');
55
-define('lang_File_info','file info');
56
-define('lang_Edit_image','edit image');
57
-define('lang_Duplicate','Duplicate');
2
+define('lang_Select', 'Избери');
3
+define('lang_Erase', 'Изтрий');
4
+define('lang_Open', 'Отвори');
5
+define('lang_Confirm_del', 'Сигурни ли сте, че искате да изтриете този файл?');
6
+define('lang_All', 'Всичко');
7
+define('lang_Files', 'Файлове');
8
+define('lang_Images', 'Изображения');
9
+define('lang_Archives', 'Архиви');
10
+define('lang_Error_Upload', 'Каченият файл надминава максимално разрешената големина.');
11
+define('lang_Error_extension', 'Това файлово разширение не е позволено.');
12
+define('lang_Upload_file', 'Качете файл');
13
+define('lang_Filters', 'Папка');
14
+define('lang_Videos', 'Видео');
15
+define('lang_Music', 'Музика');
16
+define('lang_New_Folder', 'Нова папка');
17
+define('lang_Folder_Created', 'Папката е правилно създадена');
18
+define('lang_Existing_Folder', 'Съществуваща папка');
19
+define('lang_Confirm_Folder_del', 'Сигурни ли сте, че искате да изтриете папката и всичко, което се съдържа с нея?');
20
+define('lang_Return_Files_List', 'Връщане към списъка с файлове');
21
+define('lang_Preview', 'Преглед');
22
+define('lang_Download', 'Свали');
23
+define('lang_Insert_Folder_Name', 'Въведете име на папката:');
24
+define('lang_Root', 'root');
25
+define('lang_Rename', 'Преименуване');
26
+define('lang_Back', 'обратно');
27
+define('lang_View', 'View');
28
+define('lang_View_list', 'List view');
29
+define('lang_View_columns_list', 'Columns list view');
30
+define('lang_View_boxes', 'Box view');
31
+define('lang_Toolbar', 'Toolbar');
32
+define('lang_Actions', 'Actions');
33
+define('lang_Rename_existing_file', 'The file is already existing');
34
+define('lang_Rename_existing_folder', 'The folder is already existing');
35
+define('lang_Empty_name', 'The name is empty');
36
+define('lang_Text_filter', 'text filter');
37
+define('lang_Swipe_help', 'Swipe the name of file/folder to show options');
38
+define('lang_Upload_base', 'Base upload');
39
+define('lang_Upload_java', 'JAVA upload (big size files)');
40
+define('lang_Upload_java_help', "If the Java Applet don't load 1. make sure you have Java installed otherwise <a href='http://java.com/en/download/'>[download link]</a> 2. make sure nothing is blocked from firewall");
41
+define('lang_Upload_base_help', "Drag & Drop file/s inside above area or click in it (for modern browsers) otherwise select the file and click on button. When the upload end, click on upper return button.");
42
+define('lang_Type_dir', 'dir');
43
+define('lang_Type', 'Type');
44
+define('lang_Dimension', 'Dimension');
45
+define('lang_Size', 'Size');
46
+define('lang_Date', 'Date');
47
+define('lang_Filename', 'Name');
48
+define('lang_Operations', 'Operations');
49
+define('lang_Date_type', 'y-m-d');
50
+define('lang_OK', 'OK');
51
+define('lang_Cancel', 'Cancel');
52
+define('lang_Sorting', 'sorting');
53
+define('lang_Show_url', 'show URL');
54
+define('lang_Extract', 'extract here');
55
+define('lang_File_info', 'file info');
56
+define('lang_Edit_image', 'edit image');
57
+define('lang_Duplicate', 'Duplicate');
58 58
 define('lang_Folders', 'Folders');
59
-define('lang_Copy','Copy');
60
-define('lang_Cut','Cut');
61
-define('lang_Paste','Paste');
59
+define('lang_Copy', 'Copy');
60
+define('lang_Cut', 'Cut');
61
+define('lang_Paste', 'Paste');
62 62
 define('lang_CB', 'CB'); // clipboard
63
-define('lang_Paste_Here','Paste to this directory');
64
-define('lang_Paste_Confirm','Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.');
65
-define('lang_Paste_Failed','Failed to paste file(s)');
66
-define('lang_Clear_Clipboard','Clear clipboard');
67
-define('lang_Clear_Clipboard_Confirm','Are you sure you want to clear the clipboard?');
68
-define('lang_Files_ON_Clipboard','There are files on the clipboard.');
69
-define('lang_Copy_Cut_Size_Limit','The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy
70
-define('lang_Copy_Cut_Count_Limit','You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy
71
-define('lang_Copy_Cut_Not_Allowed','You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders
63
+define('lang_Paste_Here', 'Paste to this directory');
64
+define('lang_Paste_Confirm', 'Are you sure you want to paste to this directory? This will overwrite existing files/folders if encountered any.');
65
+define('lang_Paste_Failed', 'Failed to paste file(s)');
66
+define('lang_Clear_Clipboard', 'Clear clipboard');
67
+define('lang_Clear_Clipboard_Confirm', 'Are you sure you want to clear the clipboard?');
68
+define('lang_Files_ON_Clipboard', 'There are files on the clipboard.');
69
+define('lang_Copy_Cut_Size_Limit', 'The selected files/folders are too big to %s. Limit: %d MB/operation'); // %s = cut or copy
70
+define('lang_Copy_Cut_Count_Limit', 'You selected too many files/folders to %s. Limit: %d files/operation'); // %s = cut or copy
71
+define('lang_Copy_Cut_Not_Allowed', 'You are not allowed to %s files.'); // %s(1) = cut or copy, %s(2) = files or folders
72 72
 define('lang_Aviary_No_Save', 'Could not save image');
73 73
 define('lang_Zip_No_Extract', 'Could not extract. File might be corrupt.');
74 74
 define('lang_Zip_Invalid', 'This extension is not supported. Valid: zip, gz, tar.');
Please login to merge, or discard this patch.
class/xoopseditor/tinymce4/external_plugins/filemanager/lang/nb_NO.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -1,74 +1,74 @@
 block discarded – undo
1 1
 <?php
2
-define('lang_Select','Velg');
3
-define('lang_Erase','Slett');
4
-define('lang_Open','Åpne');
5
-define('lang_Confirm_del','Er du sikker på at du vil slette denne filen?');
6
-define('lang_All','Alle');
7
-define('lang_Files','Filer');
8
-define('lang_Images','Bilder');
9
-define('lang_Archives','Arkiv');
10
-define('lang_Error_Upload','Den opplastede filen overskrider maksimal tillatt størrelse.');
11
-define('lang_Error_extension','Filtypen er ikke tillatt.');
12
-define('lang_Upload_file','Last opp fil');
13
-define('lang_Filters','Filter');
14
-define('lang_Videos','Videoer');
15
-define('lang_Music','Musikk');
16
-define('lang_New_Folder','Ny mappe');
17
-define('lang_Folder_Created','Mappe opprettet');
18
-define('lang_Existing_Folder','Eksisterende mappe');
19
-define('lang_Confirm_Folder_del','Er du sikker på at du vil slette mappen og alt innholdet?');
20
-define('lang_Return_Files_List','Tilbake til filoversikten');
21
-define('lang_Preview','Forhåndsvisning');
22
-define('lang_Download','Last ned');
23
-define('lang_Insert_Folder_Name','Gi mappen et navn:');
24
-define('lang_Root','Rot');
25
-define('lang_Rename','Gi nytt navn');
26
-define('lang_Back','Tilbake');
27
-define('lang_View','Visning');
28
-define('lang_View_list','Listevisning');
29
-define('lang_View_columns_list','Side ved side');
30
-define('lang_View_boxes','Boksvisning');
31
-define('lang_Toolbar','Verktøylinje');
32
-define('lang_Actions','Gjøremål');
33
-define('lang_Rename_existing_file','Filen er allerede opprettet');
34
-define('lang_Rename_existing_folder','Mappen er allerede opprettet');
35
-define('lang_Empty_name','Tomt navn');
36
-define('lang_Text_filter','Tekst-filter');
37
-define('lang_Swipe_help','Sveip filnavnet/mappenavnet for å vise alternativer');
38
-define('lang_Upload_base','Vanlig opplasting');
39
-define('lang_Upload_java','Java-opplasting (store filer)');
40
-define('lang_Upload_java_help',"Hvis java-appleten ikke lastes: 1. Sjekk om Java er installert, hvis ikke <a href='http://java.com/en/download/'>last ned Java</a> 2. Sjekk brannmur-innstillingene.");
41
-define('lang_Upload_base_help',"Dra og slipp filen(e) i området over eller klikk (virker for moderne nettlesere). Ved bruk av gammel nettleser: Velg filen og klikk på knappen. Når opplastingen er ferdig, klikk på tilbake-knappen øverst.");
42
-define('lang_Type_dir','Mappe');
43
-define('lang_Type','Type');
44
-define('lang_Dimension','Dimensjoner');
45
-define('lang_Size','Størrelse');
46
-define('lang_Date','Dato');
47
-define('lang_Filename','Filnavn');
48
-define('lang_Operations','Handlinger');
49
-define('lang_Date_type','d.m.y');
50
-define('lang_OK','OK');
51
-define('lang_Cancel','Avbryt');
52
-define('lang_Sorting','Sortering');
53
-define('lang_Show_url','Vis URL');
54
-define('lang_Extract','Pakk ut her');
55
-define('lang_File_info','Fil-info');
56
-define('lang_Edit_image','Rediger bilde');
57
-define('lang_Duplicate','Duplikat');
2
+define('lang_Select', 'Velg');
3
+define('lang_Erase', 'Slett');
4
+define('lang_Open', 'Åpne');
5
+define('lang_Confirm_del', 'Er du sikker på at du vil slette denne filen?');
6
+define('lang_All', 'Alle');
7
+define('lang_Files', 'Filer');
8
+define('lang_Images', 'Bilder');
9
+define('lang_Archives', 'Arkiv');
10
+define('lang_Error_Upload', 'Den opplastede filen overskrider maksimal tillatt størrelse.');
11
+define('lang_Error_extension', 'Filtypen er ikke tillatt.');
12
+define('lang_Upload_file', 'Last opp fil');
13
+define('lang_Filters', 'Filter');
14
+define('lang_Videos', 'Videoer');
15
+define('lang_Music', 'Musikk');
16
+define('lang_New_Folder', 'Ny mappe');
17
+define('lang_Folder_Created', 'Mappe opprettet');
18
+define('lang_Existing_Folder', 'Eksisterende mappe');
19
+define('lang_Confirm_Folder_del', 'Er du sikker på at du vil slette mappen og alt innholdet?');
20
+define('lang_Return_Files_List', 'Tilbake til filoversikten');
21
+define('lang_Preview', 'Forhåndsvisning');
22
+define('lang_Download', 'Last ned');
23
+define('lang_Insert_Folder_Name', 'Gi mappen et navn:');
24
+define('lang_Root', 'Rot');
25
+define('lang_Rename', 'Gi nytt navn');
26
+define('lang_Back', 'Tilbake');
27
+define('lang_View', 'Visning');
28
+define('lang_View_list', 'Listevisning');
29
+define('lang_View_columns_list', 'Side ved side');
30
+define('lang_View_boxes', 'Boksvisning');
31
+define('lang_Toolbar', 'Verktøylinje');
32
+define('lang_Actions', 'Gjøremål');
33
+define('lang_Rename_existing_file', 'Filen er allerede opprettet');
34
+define('lang_Rename_existing_folder', 'Mappen er allerede opprettet');
35
+define('lang_Empty_name', 'Tomt navn');
36
+define('lang_Text_filter', 'Tekst-filter');
37
+define('lang_Swipe_help', 'Sveip filnavnet/mappenavnet for å vise alternativer');
38
+define('lang_Upload_base', 'Vanlig opplasting');
39
+define('lang_Upload_java', 'Java-opplasting (store filer)');
40
+define('lang_Upload_java_help', "Hvis java-appleten ikke lastes: 1. Sjekk om Java er installert, hvis ikke <a href='http://java.com/en/download/'>last ned Java</a> 2. Sjekk brannmur-innstillingene.");
41
+define('lang_Upload_base_help', "Dra og slipp filen(e) i området over eller klikk (virker for moderne nettlesere). Ved bruk av gammel nettleser: Velg filen og klikk på knappen. Når opplastingen er ferdig, klikk på tilbake-knappen øverst.");
42
+define('lang_Type_dir', 'Mappe');
43
+define('lang_Type', 'Type');
44
+define('lang_Dimension', 'Dimensjoner');
45
+define('lang_Size', 'Størrelse');
46
+define('lang_Date', 'Dato');
47
+define('lang_Filename', 'Filnavn');
48
+define('lang_Operations', 'Handlinger');
49
+define('lang_Date_type', 'd.m.y');
50
+define('lang_OK', 'OK');
51
+define('lang_Cancel', 'Avbryt');
52
+define('lang_Sorting', 'Sortering');
53
+define('lang_Show_url', 'Vis URL');
54
+define('lang_Extract', 'Pakk ut her');
55
+define('lang_File_info', 'Fil-info');
56
+define('lang_Edit_image', 'Rediger bilde');
57
+define('lang_Duplicate', 'Duplikat');
58 58
 define('lang_Folders', 'Mapper');
59
-define('lang_Copy','Kopier');
60
-define('lang_Cut','Klipp ut');
61
-define('lang_Paste','Lim inn');
59
+define('lang_Copy', 'Kopier');
60
+define('lang_Cut', 'Klipp ut');
61
+define('lang_Paste', 'Lim inn');
62 62
 define('lang_CB', 'Utklippstavle'); // clipboard
63
-define('lang_Paste_Here','Lim inn i denne mappen');
64
-define('lang_Paste_Confirm','Er du sikker på at du vil lime inn i denne mappen? Dette vil overskrive eventuelle eksisterende filer eller mapper.');
65
-define('lang_Paste_Failed','Lim inn feilet');
66
-define('lang_Clear_Clipboard','Tøm utklippstavlen');
67
-define('lang_Clear_Clipboard_Confirm','Er du sikker på at du vil tømme utklippstavlen?');
68
-define('lang_Files_ON_Clipboard','Der er filer på utklippstavlen.');
69
-define('lang_Copy_Cut_Size_Limit','De valgte filene/mappene er for store for %s. Grense: %d MB/operasjon'); // %s = cut or copy
70
-define('lang_Copy_Cut_Count_Limit','Du valgte for mange filer/mapper for %s. Grense: %d filer/operasjon'); // %s = cut or copy
71
-define('lang_Copy_Cut_Not_Allowed','Du har ikke lov til å %s filer.'); // %s(1) = cut or copy, %s(2) = files or folders
63
+define('lang_Paste_Here', 'Lim inn i denne mappen');
64
+define('lang_Paste_Confirm', 'Er du sikker på at du vil lime inn i denne mappen? Dette vil overskrive eventuelle eksisterende filer eller mapper.');
65
+define('lang_Paste_Failed', 'Lim inn feilet');
66
+define('lang_Clear_Clipboard', 'Tøm utklippstavlen');
67
+define('lang_Clear_Clipboard_Confirm', 'Er du sikker på at du vil tømme utklippstavlen?');
68
+define('lang_Files_ON_Clipboard', 'Der er filer på utklippstavlen.');
69
+define('lang_Copy_Cut_Size_Limit', 'De valgte filene/mappene er for store for %s. Grense: %d MB/operasjon'); // %s = cut or copy
70
+define('lang_Copy_Cut_Count_Limit', 'Du valgte for mange filer/mapper for %s. Grense: %d filer/operasjon'); // %s = cut or copy
71
+define('lang_Copy_Cut_Not_Allowed', 'Du har ikke lov til å %s filer.'); // %s(1) = cut or copy, %s(2) = files or folders
72 72
 define('lang_Aviary_No_Save', 'Kunne ikke lagre bildet');
73 73
 define('lang_Zip_No_Extract', 'Kunne ikke pakke ut. Filen er muligens ødelagt.');
74 74
 define('lang_Zip_Invalid', 'Dette filetternavnet er ikke støttet. Valide filer: zip, gz, tar.');
Please login to merge, or discard this patch.
xoopseditor/tinymce4/external_plugins/filemanager/uploader/jupload.php 3 patches
Indentation   +641 added lines, -641 removed lines patch added patch discarded remove patch
@@ -54,403 +54,403 @@  discard block
 block discarded – undo
54 54
 
55 55
 class JUpload {
56 56
 
57
-	var $appletparams;
58
-	var $classparams;
59
-	var $files;
60
-
61
-	public function JUpload($appletparams = array(), $classparams = array()) {
62
-		if (gettype($classparams) !== 'array')
63
-		$this->abort('Invalid type of parameter classparams: Expecting an array');
64
-		if (gettype($appletparams) !== 'array')
65
-		$this->abort('Invalid type of parameter appletparams: Expecting an array');
66
-
67
-		// set some defaults for the applet params
68
-		if (!isset($appletparams['afterUploadURL']))
69
-		$appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1';
70
-		if (!isset($appletparams['name']))
71
-		$appletparams['name'] = 'JUpload';
72
-		if (!isset($appletparams['archive']))
73
-		$appletparams['archive'] = 'wjhk.jupload.jar';
74
-		if (!isset($appletparams['code']))
75
-		$appletparams['code'] = 'wjhk.jupload2.JUploadApplet';
76
-		if (!isset($appletparams['debugLevel']))
77
-		$appletparams['debugLevel'] = 0;
78
-		if (!isset($appletparams['httpUploadParameterType']))
79
-		$appletparams['httpUploadParameterType'] = 'array';
80
-		if (!isset($appletparams['showLogWindow']))
81
-		$appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false';
82
-		if (!isset($appletparams['width']))
83
-		$appletparams['width'] = 640;
84
-		if (!isset($appletparams['height']))
85
-		$appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300;
86
-		if (!isset($appletparams['mayscript']))
87
-		$appletparams['mayscript'] = 'true';
88
-		if (!isset($appletparams['scriptable']))
89
-		$appletparams['scriptable'] = 'false';
90
-		//if (!isset($appletparams['stringUploadSuccess']))
91
-		$appletparams['stringUploadSuccess'] = 'SUCCESS';
92
-		//if (!isset($appletparams['stringUploadError']))
93
-		$appletparams['stringUploadError'] = 'ERROR: (.*)';
94
-		$maxpost = $this->tobytes(ini_get('post_max_size'));
95
-		$maxmem = $this->tobytes(ini_get('memory_limit'));
96
-		$maxfs = $this->tobytes(ini_get('upload_max_filesize'));
97
-		$obd = ini_get('open_basedir');
98
-		if (!isset($appletparams['maxChunkSize'])) {
99
-			$maxchunk = ($maxpost < $maxmem) ? $maxpost : $maxmem;
100
-			$maxchunk = ($maxchunk < $maxfs) ? $maxchunk : $maxfs;
101
-			$maxchunk /= 4;
102
-			$optchunk = (500000 > $maxchunk) ? $maxchunk : 500000;
103
-			$appletparams['maxChunkSize'] = $optchunk;
104
-		}
105
-		$appletparams['maxChunkSize'] = $this->tobytes($appletparams['maxChunkSize']);
106
-		if (!isset($appletparams['maxFileSize']))
107
-		$appletparams['maxFileSize'] = $maxfs;
108
-		$appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']);
109
-		if (isset($classparams['errormail'])) {
110
-			$appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail';
111
-		}
112
-
113
-		// Same for class parameters
114
-		if (!isset($classparams['demo_mode']))
115
-		$classparams['demo_mode'] = false;
116
-		if ($classparams['demo_mode']) {
117
-			$classparams['create_destdir'] = false;
118
-			$classparams['allow_subdirs'] = true;
119
-			$classparams['allow_zerosized'] = true;
120
-			$classparams['duplicate'] = 'overwrite';
121
-		}
122
-		if (!isset($classparams['debug_php']))											// set true to log some messages in PHP log
123
-		$classparams['debug_php'] = false;
124
-		if (!isset($this->classparams['allowed_mime_types']))				// array of allowed MIME type
125
-		$classparams['allowed_mime_types'] = 'all';
126
-		if (!isset($this->classparams['allowed_file_extensions'])) 	// array of allowed file extensions
127
-		$classparams['allowed_file_extensions'] = 'all';
128
-		if (!isset($classparams['verbose_errors']))						// shouldn't display server info on a production site!
129
-		$classparams['verbose_errors'] = true;
130
-		if (!isset($classparams['session_regenerate']))
131
-		$classparams['session_regenerate'] = false;
132
-		if (!isset($classparams['create_destdir']))
133
-		$classparams['create_destdir'] = true;
134
-		if (!isset($classparams['allow_subdirs']))
135
-		$classparams['allow_subdirs'] = false;
136
-		if (!isset($classparams['spaces_in_subdirs']))
137
-		$classparams['spaces_in_subdirs'] = false;
138
-		if (!isset($classparams['allow_zerosized']))
139
-		$classparams['allow_zerosized'] = false;
140
-		if (!isset($classparams['duplicate']))
141
-		$classparams['duplicate'] = 'rename';
142
-		if (!isset($classparams['dirperm']))
143
-		$classparams['dirperm'] = 0755;
144
-		if (!isset($classparams['fileperm']))
145
-		$classparams['fileperm'] = 0644;
146
-		if (!isset($classparams['destdir'])) {
147
-			if ($obd != '')
148
-			$classparams['destdir'] = $obd;
149
-			else
150
-			$classparams['destdir'] = '/var/tmp/jupload_test';
151
-		}else{
152
-			$classparams['destdir']=str_replace('~',' ',$classparams['destdir']);
153
-		}
154
-		if ($classparams['create_destdir']) {
155
-			$_umask = umask(0); 	// override the system mask
156
-			@mkdir($classparams['destdir'], $classparams['dirperm']);
157
-			umask($_umask);
158
-		}
159
-		if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir']))
160
-		$this->abort('Destination dir not accessible');
161
-		if (!isset($classparams['tmp_prefix']))
162
-		$classparams['tmp_prefix'] = 'jutmp.';
163
-		if (!isset($classparams['var_prefix']))
164
-		$classparams['var_prefix'] = 'juvar.';
165
-		if (!isset($classparams['jscript_wrapper']))
166
-		$classparams['jscript_wrapper'] = 'JUploadSetProperty';
167
-		if (!isset($classparams['tag_jscript']))
168
-		$classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->';
169
-		if (!isset($classparams['tag_applet']))
170
-		$classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->';
171
-		if (!isset($classparams['tag_flist']))
172
-		$classparams['tag_flist'] = '<!--JUPLOAD_FILES-->';
173
-		if (!isset($classparams['http_flist_start']))
174
-		$classparams['http_flist_start'] =
175
-            		"<table border='1'><TR><TH>Filename</TH><TH>file size</TH><TH>Relative path</TH><TH>Full name</TH><TH>md5sum</TH><TH>Specific parameters</TH></TR>";
176
-		if (!isset($classparams['http_flist_end']))
177
-		$classparams['http_flist_end'] = "</table>\n";
178
-		if (!isset($classparams['http_flist_file_before']))
179
-		$classparams['http_flist_file_before'] = "<tr><td>";
180
-		if (!isset($classparams['http_flist_file_between']))
181
-		$classparams['http_flist_file_between'] = "</td><td>";
182
-		if (!isset($classparams['http_flist_file_after']))
183
-		$classparams['http_flist_file_after'] = "</td></tr>\n";
184
-
185
-		$this->appletparams = $appletparams;
186
-		$this->classparams = $classparams;
187
-		$this->page_start();
188
-	}
189
-
190
-	/**
191
-	 * Return an array of uploaded files * The array contains: name, size, tmp_name, error,
192
-	 * relativePath, md5sum, mimetype, fullName, path
193
-	 */
194
-	public function uploadedfiles() {
195
-		return $this->files;
196
-	}
197
-
198
-	/**
199
-	 * Log a message on the current output, as a HTML comment.
200
-	 */
201
-	protected function logDebug($function, $msg, $htmlComment=true) {
202
-		$output = "[DEBUG] [$function] $msg";
203
-		if ($htmlComment) {
204
-			echo("<!-- $output -->\r\n");
205
-		} else {
206
-			echo("$output\r\n");
207
-		}
208
-	}
209
-
210
-	/**
211
-	 * Log a message to the PHP log.
212
-	 * Declared "protected" so it may be Extended if you require customised logging (e.g. particular log file location).
213
-	 */
214
-	protected function logPHPDebug($function, $msg) {
215
-		if ($this->classparams['debug_php'] === true) {
216
-			$output = "[DEBUG] [$function] ".$this->arrayexpand($msg);
217
-			error_log($output);
218
-		}
219
-	}
220
-
221
-	private function arrayexpand($array) {
222
-		$output = '';
223
-		if (is_array($array)) {
224
-			foreach ($array as $key => $value) {
225
-				$output .= "\n ".$key.' => '.$this->arrayexpand($value);
226
-			}
227
-		} else {
228
-			$output .= $array;
229
-		}
230
-		return $output;
231
-	}
232
-
233
-
234
-	/**
235
-	 * Convert a value ending in 'G','M' or 'K' to bytes
236
-	 *
237
-	 */
238
-	private function tobytes($val) {
239
-		$val = trim($val);
240
-		$last = fix_strtolower($val{strlen($val)-1});
241
-		switch($last) {
242
-			case 'g':
243
-				$val *= 1024;
244
-			case 'm':
245
-				$val *= 1024;
246
-			case 'k':
247
-				$val *= 1024;
248
-		}
249
-		return $val;
250
-	}
251
-
252
-	/**
253
-	 * Build a string, containing a javascript wrapper function
254
-	 * for setting applet properties via JavaScript. This is necessary,
255
-	 * because we use the "modern" method of including the applet (using
256
-	 * <object> resp. <embed> tags) in order to trigger automatic JRE downloading.
257
-	 * Therefore, in Netscape-like browsers, the applet is accessible via
258
-	 * the document.embeds[] array while in others, it is accessible via the
259
-	 * document.applets[] array.
260
-	 *
261
-	 * @return A string, containing the necessary wrapper function (named JUploadSetProperty)
262
-	 */
263
-	private function str_jsinit() {
264
-		$N = "\n";
265
-		$name = $this->appletparams['name'];
266
-		$ret = '<script type="text/javascript">'.$N;
267
-		$ret .= '<!--'.$N;
268
-		$ret .= 'function '.$this->classparams['jscript_wrapper'].'(name, value) {'.$N;
269
-		$ret .= '  document.applets["'.$name.'"] == null || document.applets["'.$name.'"].setProperty(name,value);'.$N;
270
-		$ret .= '  document.embeds["'.$name.'"] == null || document.embeds["'.$name.'"].setProperty(name,value);'.$N;
271
-		$ret .= '}'.$N;
272
-		$ret .= '//-->'.$N;
273
-		$ret .= '</script>';
274
-		return $ret;
275
-	}
276
-
277
-	/**
278
-	 * Build a string, containing the applet tag with all parameters.
279
-	 *
280
-	 * @return A string, containing the applet tag
281
-	 */
282
-	private function str_applet() {
283
-		$N = "\n";
284
-		$params = $this->appletparams;
285
-		// return the actual applet tag
286
-		$ret = '<object classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"'.$N;
287
-		$ret .= '  codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"'.$N;
288
-		$ret .= '  width = "'.$params['width'].'"'.$N;
289
-		$ret .= '  height = "'.$params['height'].'"'.$N;
290
-		$ret .= '  name = "'.$params['name'].'">'.$N;
291
-		foreach ($params as $key => $val) {
292
-			if ($key !== 'width' && $key !== 'height')
293
-			$ret .= '  <param name = "'.$key.'" value = "'.$val.'" />'.$N;
294
-		}
295
-		$ret .= '  <comment>'.$N;
296
-		$ret .= '    <embed'.$N;
297
-		$ret .= '      type = "application/x-java-applet;version=1.5"'.$N;
298
-		foreach ($params as $key => $val)
299
-		$ret .= '      '.$key.' = "'.$val.'"'.$N;
300
-		$ret .= '      pluginspage = "http://java.sun.com/products/plugin/index.html#download">'.$N;
301
-		$ret .= '      <noembed>'.$N;
302
-		$ret .= '        Java 1.5 or higher plugin required.'.$N;
303
-		$ret .= '      </noembed>'.$N;
304
-		$ret .= '    </embed>'.$N;
305
-		$ret .= '  </comment>'.$N;
306
-		$ret .= '</object>';
307
-		return $ret;
308
-	}
309
-
310
-	private function abort($msg = '') {
311
-		$this->cleanup();
312
-		if ($msg != '')
313
-		die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n");
314
-		exit;
315
-	}
316
-
317
-	private function warning($msg = '') {
318
-		$this->cleanup();
319
-		if ($msg != '')
320
-		echo('WARNING: '.$msg."\n");
321
-		echo $this->appletparams['stringUploadSuccess']."\n";
322
-		exit;
323
-	}
324
-
325
-	private function cleanup() {
326
-		// remove all uploaded files of *this* request
327
-		if (isset($_FILES)) {
328
-			foreach ($_FILES as $key => $val)
329
-			@unlink($val['tmp_name']);
330
-		}
331
-		// remove accumulated file, if any.
332
-		@unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].session_id());
333
-		@unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].'tmp'.session_id());
334
-		// reset session var
335
-		$_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0;
336
-		return;
337
-	}
338
-
339
-	private function mkdirp($path) {
340
-		// create subdir (hierary) below destdir;
341
-		$dirs = explode('/', $path);
342
-		$path = $this->classparams['destdir'];
343
-		foreach ($dirs as $dir) {
344
-			$path .= '/'.$dir;
345
-			if (!file_exists($path)) {  // @ does NOT always supress the error!
346
-				$_umask = umask(0); 	// override the system mask
347
-				@mkdir($path, $this->classparams['dirperm']);
348
-				umask($_umask);
349
-			}
350
-		}
351
-		if (!is_dir($path) && is_writable($path))
352
-		$this->abort('Destination dir not accessible');
353
-	}
354
-
355
-	/**
356
-	 * This method:
357
-	 * - Replaces some potentially dangerous characters by '_' (in the given name an relative path)
358
-	 * - Checks if a files of the same name already exists.
359
-	 * 		- If no: no problem.
360
-	 * 		- If yes, and the duplicate class param is set to rename, the file is renamed.
361
-	 * 		- If yes, and the duplicate class param is set to overwrite, the file is not renamed. The existing one will be erased.
362
-	 * 		- If yes, and the duplicate class param is set to reject, an error is thrown.
363
-	 */
364
-	private function dstfinal(&$name, &$subdir) {
365
-		$name = preg_replace('![`$\\\\/|]!', '_', $name);
366
-		if ($this->classparams['allow_subdirs'] && ($subdir != '')) {
367
-			$subdir = trim(preg_replace('!\\\\!','/',$subdir),'/');
368
-			$subdir = preg_replace('![`$|]!', '_', $subdir);
369
-			if (!$this->classparams['spaces_in_subdirs']) {
370
-				$subdir = str_replace(' ','_',$subdir);
371
-			}
372
-			// recursively create subdir
373
-			if (!$this->classparams['demo_mode'])
374
-			$this->mkdirp($subdir);
375
-			// append a slash
376
-			$subdir .= '/';
377
-		} else {
378
-			$subdir = '';
379
-		}
380
-		$ret = $this->classparams['destdir'].'/'.$subdir.$name;
381
-		if (file_exists($ret)) {
382
-			if ($this->classparams['duplicate'] === 'overwrite') {
383
-				return $ret;
384
-			}
385
-			if ($this->classparams['duplicate'] === 'reject') {
386
-				$this->abort('A file with the same name already exists');
387
-			}
388
-			if ($this->classparams['duplicate'] === 'warning') {
389
-				$this->warning("File $name already exists - rejected");
390
-			}
391
-			if ($this->classparams['duplicate'] === 'rename') {
392
-				$cnt = 1;
393
-				$dir = $this->classparams['destdir'].'/'.$subdir;
394
-				$ext = strrchr($name, '.');
395
-				if ($ext) {
396
-					$nameWithoutExtension = substr($name, 0, strlen($name) - strlen($ext));
397
-				} else {
398
-					$ext = '';
399
-					$nameWithoutExtension = $name;
400
-				}
401
-
402
-				$rtry = $dir.$nameWithoutExtension.'_'.$cnt.$ext;
403
-				while (file_exists($rtry)) {
404
-					$cnt++;
405
-					$rtry = $dir.$nameWithoutExtension.'._'.$cnt.$ext;
406
-				}
407
-				//We store the result name in the byReference name parameter.
408
-				$name = $nameWithoutExtension.'_'.$cnt.$ext;
409
-				$ret = $rtry;
410
-			}
411
-		}
412
-		return $ret;
413
-	}
414
-
415
-	/**
416
-	 * Example function to process the files uploaded.  This one simply displays the files' data.
417
-	 *
418
-	 */
419
-	public function defaultAfterUploadManagement() {
420
-		$flist = '[defaultAfterUploadManagement] Nb uploaded files is: ' . sizeof($this->files);
421
-		$flist = $this->classparams['http_flist_start'];
422
-		foreach ($this->files as $f) {
423
-			//$f is an array, that contains all info about the uploaded file.
424
-			$this->logDebug('defaultAfterUploadManagement', "  Reading file ${f['name']}");
425
-			$flist .= $this->classparams['http_flist_file_before'];
426
-			$flist .= $f['name'];
427
-			$flist .= $this->classparams['http_flist_file_between'];
428
-			$flist .= $f['size'];
429
-			$flist .= $this->classparams['http_flist_file_between'];
430
-			$flist .= $f['relativePath'];
431
-			$flist .= $this->classparams['http_flist_file_between'];
432
-			$flist .= $f['fullName'];
433
-			$flist .= $this->classparams['http_flist_file_between'];
434
-			$flist .= $f['md5sum'];
435
-			$addBR = false;
436
-			foreach ($f as $key=>$value) {
437
-				//If it's a specific key, let's display it:
438
-				if ($key !== 'name' && $key !== 'size' && $key !== 'relativePath' && $key !== 'fullName' && $key !== 'md5sum') {
439
-					if ($addBR) {
440
-						$flist .= "<br>";
441
-					} else {
442
-						// First line. We must add a new 'official' list separator.
443
-						$flist .= $this->classparams['http_flist_file_between'];
444
-						$addBR = true;
445
-					}
446
-					$flist .= "$key => $value";
447
-				}
448
-			}
449
-			$flist .= $this->classparams['http_flist_file_after'];
450
-	}
451
-	$flist .= $this->classparams['http_flist_end'];
452
-
453
-	return $flist;
57
+    var $appletparams;
58
+    var $classparams;
59
+    var $files;
60
+
61
+    public function JUpload($appletparams = array(), $classparams = array()) {
62
+        if (gettype($classparams) !== 'array')
63
+        $this->abort('Invalid type of parameter classparams: Expecting an array');
64
+        if (gettype($appletparams) !== 'array')
65
+        $this->abort('Invalid type of parameter appletparams: Expecting an array');
66
+
67
+        // set some defaults for the applet params
68
+        if (!isset($appletparams['afterUploadURL']))
69
+        $appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1';
70
+        if (!isset($appletparams['name']))
71
+        $appletparams['name'] = 'JUpload';
72
+        if (!isset($appletparams['archive']))
73
+        $appletparams['archive'] = 'wjhk.jupload.jar';
74
+        if (!isset($appletparams['code']))
75
+        $appletparams['code'] = 'wjhk.jupload2.JUploadApplet';
76
+        if (!isset($appletparams['debugLevel']))
77
+        $appletparams['debugLevel'] = 0;
78
+        if (!isset($appletparams['httpUploadParameterType']))
79
+        $appletparams['httpUploadParameterType'] = 'array';
80
+        if (!isset($appletparams['showLogWindow']))
81
+        $appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false';
82
+        if (!isset($appletparams['width']))
83
+        $appletparams['width'] = 640;
84
+        if (!isset($appletparams['height']))
85
+        $appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300;
86
+        if (!isset($appletparams['mayscript']))
87
+        $appletparams['mayscript'] = 'true';
88
+        if (!isset($appletparams['scriptable']))
89
+        $appletparams['scriptable'] = 'false';
90
+        //if (!isset($appletparams['stringUploadSuccess']))
91
+        $appletparams['stringUploadSuccess'] = 'SUCCESS';
92
+        //if (!isset($appletparams['stringUploadError']))
93
+        $appletparams['stringUploadError'] = 'ERROR: (.*)';
94
+        $maxpost = $this->tobytes(ini_get('post_max_size'));
95
+        $maxmem = $this->tobytes(ini_get('memory_limit'));
96
+        $maxfs = $this->tobytes(ini_get('upload_max_filesize'));
97
+        $obd = ini_get('open_basedir');
98
+        if (!isset($appletparams['maxChunkSize'])) {
99
+            $maxchunk = ($maxpost < $maxmem) ? $maxpost : $maxmem;
100
+            $maxchunk = ($maxchunk < $maxfs) ? $maxchunk : $maxfs;
101
+            $maxchunk /= 4;
102
+            $optchunk = (500000 > $maxchunk) ? $maxchunk : 500000;
103
+            $appletparams['maxChunkSize'] = $optchunk;
104
+        }
105
+        $appletparams['maxChunkSize'] = $this->tobytes($appletparams['maxChunkSize']);
106
+        if (!isset($appletparams['maxFileSize']))
107
+        $appletparams['maxFileSize'] = $maxfs;
108
+        $appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']);
109
+        if (isset($classparams['errormail'])) {
110
+            $appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail';
111
+        }
112
+
113
+        // Same for class parameters
114
+        if (!isset($classparams['demo_mode']))
115
+        $classparams['demo_mode'] = false;
116
+        if ($classparams['demo_mode']) {
117
+            $classparams['create_destdir'] = false;
118
+            $classparams['allow_subdirs'] = true;
119
+            $classparams['allow_zerosized'] = true;
120
+            $classparams['duplicate'] = 'overwrite';
121
+        }
122
+        if (!isset($classparams['debug_php']))											// set true to log some messages in PHP log
123
+        $classparams['debug_php'] = false;
124
+        if (!isset($this->classparams['allowed_mime_types']))				// array of allowed MIME type
125
+        $classparams['allowed_mime_types'] = 'all';
126
+        if (!isset($this->classparams['allowed_file_extensions'])) 	// array of allowed file extensions
127
+        $classparams['allowed_file_extensions'] = 'all';
128
+        if (!isset($classparams['verbose_errors']))						// shouldn't display server info on a production site!
129
+        $classparams['verbose_errors'] = true;
130
+        if (!isset($classparams['session_regenerate']))
131
+        $classparams['session_regenerate'] = false;
132
+        if (!isset($classparams['create_destdir']))
133
+        $classparams['create_destdir'] = true;
134
+        if (!isset($classparams['allow_subdirs']))
135
+        $classparams['allow_subdirs'] = false;
136
+        if (!isset($classparams['spaces_in_subdirs']))
137
+        $classparams['spaces_in_subdirs'] = false;
138
+        if (!isset($classparams['allow_zerosized']))
139
+        $classparams['allow_zerosized'] = false;
140
+        if (!isset($classparams['duplicate']))
141
+        $classparams['duplicate'] = 'rename';
142
+        if (!isset($classparams['dirperm']))
143
+        $classparams['dirperm'] = 0755;
144
+        if (!isset($classparams['fileperm']))
145
+        $classparams['fileperm'] = 0644;
146
+        if (!isset($classparams['destdir'])) {
147
+            if ($obd != '')
148
+            $classparams['destdir'] = $obd;
149
+            else
150
+            $classparams['destdir'] = '/var/tmp/jupload_test';
151
+        }else{
152
+            $classparams['destdir']=str_replace('~',' ',$classparams['destdir']);
153
+        }
154
+        if ($classparams['create_destdir']) {
155
+            $_umask = umask(0); 	// override the system mask
156
+            @mkdir($classparams['destdir'], $classparams['dirperm']);
157
+            umask($_umask);
158
+        }
159
+        if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir']))
160
+        $this->abort('Destination dir not accessible');
161
+        if (!isset($classparams['tmp_prefix']))
162
+        $classparams['tmp_prefix'] = 'jutmp.';
163
+        if (!isset($classparams['var_prefix']))
164
+        $classparams['var_prefix'] = 'juvar.';
165
+        if (!isset($classparams['jscript_wrapper']))
166
+        $classparams['jscript_wrapper'] = 'JUploadSetProperty';
167
+        if (!isset($classparams['tag_jscript']))
168
+        $classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->';
169
+        if (!isset($classparams['tag_applet']))
170
+        $classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->';
171
+        if (!isset($classparams['tag_flist']))
172
+        $classparams['tag_flist'] = '<!--JUPLOAD_FILES-->';
173
+        if (!isset($classparams['http_flist_start']))
174
+        $classparams['http_flist_start'] =
175
+                    "<table border='1'><TR><TH>Filename</TH><TH>file size</TH><TH>Relative path</TH><TH>Full name</TH><TH>md5sum</TH><TH>Specific parameters</TH></TR>";
176
+        if (!isset($classparams['http_flist_end']))
177
+        $classparams['http_flist_end'] = "</table>\n";
178
+        if (!isset($classparams['http_flist_file_before']))
179
+        $classparams['http_flist_file_before'] = "<tr><td>";
180
+        if (!isset($classparams['http_flist_file_between']))
181
+        $classparams['http_flist_file_between'] = "</td><td>";
182
+        if (!isset($classparams['http_flist_file_after']))
183
+        $classparams['http_flist_file_after'] = "</td></tr>\n";
184
+
185
+        $this->appletparams = $appletparams;
186
+        $this->classparams = $classparams;
187
+        $this->page_start();
188
+    }
189
+
190
+    /**
191
+     * Return an array of uploaded files * The array contains: name, size, tmp_name, error,
192
+     * relativePath, md5sum, mimetype, fullName, path
193
+     */
194
+    public function uploadedfiles() {
195
+        return $this->files;
196
+    }
197
+
198
+    /**
199
+     * Log a message on the current output, as a HTML comment.
200
+     */
201
+    protected function logDebug($function, $msg, $htmlComment=true) {
202
+        $output = "[DEBUG] [$function] $msg";
203
+        if ($htmlComment) {
204
+            echo("<!-- $output -->\r\n");
205
+        } else {
206
+            echo("$output\r\n");
207
+        }
208
+    }
209
+
210
+    /**
211
+     * Log a message to the PHP log.
212
+     * Declared "protected" so it may be Extended if you require customised logging (e.g. particular log file location).
213
+     */
214
+    protected function logPHPDebug($function, $msg) {
215
+        if ($this->classparams['debug_php'] === true) {
216
+            $output = "[DEBUG] [$function] ".$this->arrayexpand($msg);
217
+            error_log($output);
218
+        }
219
+    }
220
+
221
+    private function arrayexpand($array) {
222
+        $output = '';
223
+        if (is_array($array)) {
224
+            foreach ($array as $key => $value) {
225
+                $output .= "\n ".$key.' => '.$this->arrayexpand($value);
226
+            }
227
+        } else {
228
+            $output .= $array;
229
+        }
230
+        return $output;
231
+    }
232
+
233
+
234
+    /**
235
+     * Convert a value ending in 'G','M' or 'K' to bytes
236
+     *
237
+     */
238
+    private function tobytes($val) {
239
+        $val = trim($val);
240
+        $last = fix_strtolower($val{strlen($val)-1});
241
+        switch($last) {
242
+            case 'g':
243
+                $val *= 1024;
244
+            case 'm':
245
+                $val *= 1024;
246
+            case 'k':
247
+                $val *= 1024;
248
+        }
249
+        return $val;
250
+    }
251
+
252
+    /**
253
+     * Build a string, containing a javascript wrapper function
254
+     * for setting applet properties via JavaScript. This is necessary,
255
+     * because we use the "modern" method of including the applet (using
256
+     * <object> resp. <embed> tags) in order to trigger automatic JRE downloading.
257
+     * Therefore, in Netscape-like browsers, the applet is accessible via
258
+     * the document.embeds[] array while in others, it is accessible via the
259
+     * document.applets[] array.
260
+     *
261
+     * @return A string, containing the necessary wrapper function (named JUploadSetProperty)
262
+     */
263
+    private function str_jsinit() {
264
+        $N = "\n";
265
+        $name = $this->appletparams['name'];
266
+        $ret = '<script type="text/javascript">'.$N;
267
+        $ret .= '<!--'.$N;
268
+        $ret .= 'function '.$this->classparams['jscript_wrapper'].'(name, value) {'.$N;
269
+        $ret .= '  document.applets["'.$name.'"] == null || document.applets["'.$name.'"].setProperty(name,value);'.$N;
270
+        $ret .= '  document.embeds["'.$name.'"] == null || document.embeds["'.$name.'"].setProperty(name,value);'.$N;
271
+        $ret .= '}'.$N;
272
+        $ret .= '//-->'.$N;
273
+        $ret .= '</script>';
274
+        return $ret;
275
+    }
276
+
277
+    /**
278
+     * Build a string, containing the applet tag with all parameters.
279
+     *
280
+     * @return A string, containing the applet tag
281
+     */
282
+    private function str_applet() {
283
+        $N = "\n";
284
+        $params = $this->appletparams;
285
+        // return the actual applet tag
286
+        $ret = '<object classid = "clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"'.$N;
287
+        $ret .= '  codebase = "http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,3"'.$N;
288
+        $ret .= '  width = "'.$params['width'].'"'.$N;
289
+        $ret .= '  height = "'.$params['height'].'"'.$N;
290
+        $ret .= '  name = "'.$params['name'].'">'.$N;
291
+        foreach ($params as $key => $val) {
292
+            if ($key !== 'width' && $key !== 'height')
293
+            $ret .= '  <param name = "'.$key.'" value = "'.$val.'" />'.$N;
294
+        }
295
+        $ret .= '  <comment>'.$N;
296
+        $ret .= '    <embed'.$N;
297
+        $ret .= '      type = "application/x-java-applet;version=1.5"'.$N;
298
+        foreach ($params as $key => $val)
299
+        $ret .= '      '.$key.' = "'.$val.'"'.$N;
300
+        $ret .= '      pluginspage = "http://java.sun.com/products/plugin/index.html#download">'.$N;
301
+        $ret .= '      <noembed>'.$N;
302
+        $ret .= '        Java 1.5 or higher plugin required.'.$N;
303
+        $ret .= '      </noembed>'.$N;
304
+        $ret .= '    </embed>'.$N;
305
+        $ret .= '  </comment>'.$N;
306
+        $ret .= '</object>';
307
+        return $ret;
308
+    }
309
+
310
+    private function abort($msg = '') {
311
+        $this->cleanup();
312
+        if ($msg != '')
313
+        die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n");
314
+        exit;
315
+    }
316
+
317
+    private function warning($msg = '') {
318
+        $this->cleanup();
319
+        if ($msg != '')
320
+        echo('WARNING: '.$msg."\n");
321
+        echo $this->appletparams['stringUploadSuccess']."\n";
322
+        exit;
323
+    }
324
+
325
+    private function cleanup() {
326
+        // remove all uploaded files of *this* request
327
+        if (isset($_FILES)) {
328
+            foreach ($_FILES as $key => $val)
329
+            @unlink($val['tmp_name']);
330
+        }
331
+        // remove accumulated file, if any.
332
+        @unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].session_id());
333
+        @unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].'tmp'.session_id());
334
+        // reset session var
335
+        $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0;
336
+        return;
337
+    }
338
+
339
+    private function mkdirp($path) {
340
+        // create subdir (hierary) below destdir;
341
+        $dirs = explode('/', $path);
342
+        $path = $this->classparams['destdir'];
343
+        foreach ($dirs as $dir) {
344
+            $path .= '/'.$dir;
345
+            if (!file_exists($path)) {  // @ does NOT always supress the error!
346
+                $_umask = umask(0); 	// override the system mask
347
+                @mkdir($path, $this->classparams['dirperm']);
348
+                umask($_umask);
349
+            }
350
+        }
351
+        if (!is_dir($path) && is_writable($path))
352
+        $this->abort('Destination dir not accessible');
353
+    }
354
+
355
+    /**
356
+     * This method:
357
+     * - Replaces some potentially dangerous characters by '_' (in the given name an relative path)
358
+     * - Checks if a files of the same name already exists.
359
+     * 		- If no: no problem.
360
+     * 		- If yes, and the duplicate class param is set to rename, the file is renamed.
361
+     * 		- If yes, and the duplicate class param is set to overwrite, the file is not renamed. The existing one will be erased.
362
+     * 		- If yes, and the duplicate class param is set to reject, an error is thrown.
363
+     */
364
+    private function dstfinal(&$name, &$subdir) {
365
+        $name = preg_replace('![`$\\\\/|]!', '_', $name);
366
+        if ($this->classparams['allow_subdirs'] && ($subdir != '')) {
367
+            $subdir = trim(preg_replace('!\\\\!','/',$subdir),'/');
368
+            $subdir = preg_replace('![`$|]!', '_', $subdir);
369
+            if (!$this->classparams['spaces_in_subdirs']) {
370
+                $subdir = str_replace(' ','_',$subdir);
371
+            }
372
+            // recursively create subdir
373
+            if (!$this->classparams['demo_mode'])
374
+            $this->mkdirp($subdir);
375
+            // append a slash
376
+            $subdir .= '/';
377
+        } else {
378
+            $subdir = '';
379
+        }
380
+        $ret = $this->classparams['destdir'].'/'.$subdir.$name;
381
+        if (file_exists($ret)) {
382
+            if ($this->classparams['duplicate'] === 'overwrite') {
383
+                return $ret;
384
+            }
385
+            if ($this->classparams['duplicate'] === 'reject') {
386
+                $this->abort('A file with the same name already exists');
387
+            }
388
+            if ($this->classparams['duplicate'] === 'warning') {
389
+                $this->warning("File $name already exists - rejected");
390
+            }
391
+            if ($this->classparams['duplicate'] === 'rename') {
392
+                $cnt = 1;
393
+                $dir = $this->classparams['destdir'].'/'.$subdir;
394
+                $ext = strrchr($name, '.');
395
+                if ($ext) {
396
+                    $nameWithoutExtension = substr($name, 0, strlen($name) - strlen($ext));
397
+                } else {
398
+                    $ext = '';
399
+                    $nameWithoutExtension = $name;
400
+                }
401
+
402
+                $rtry = $dir.$nameWithoutExtension.'_'.$cnt.$ext;
403
+                while (file_exists($rtry)) {
404
+                    $cnt++;
405
+                    $rtry = $dir.$nameWithoutExtension.'._'.$cnt.$ext;
406
+                }
407
+                //We store the result name in the byReference name parameter.
408
+                $name = $nameWithoutExtension.'_'.$cnt.$ext;
409
+                $ret = $rtry;
410
+            }
411
+        }
412
+        return $ret;
413
+    }
414
+
415
+    /**
416
+     * Example function to process the files uploaded.  This one simply displays the files' data.
417
+     *
418
+     */
419
+    public function defaultAfterUploadManagement() {
420
+        $flist = '[defaultAfterUploadManagement] Nb uploaded files is: ' . sizeof($this->files);
421
+        $flist = $this->classparams['http_flist_start'];
422
+        foreach ($this->files as $f) {
423
+            //$f is an array, that contains all info about the uploaded file.
424
+            $this->logDebug('defaultAfterUploadManagement', "  Reading file ${f['name']}");
425
+            $flist .= $this->classparams['http_flist_file_before'];
426
+            $flist .= $f['name'];
427
+            $flist .= $this->classparams['http_flist_file_between'];
428
+            $flist .= $f['size'];
429
+            $flist .= $this->classparams['http_flist_file_between'];
430
+            $flist .= $f['relativePath'];
431
+            $flist .= $this->classparams['http_flist_file_between'];
432
+            $flist .= $f['fullName'];
433
+            $flist .= $this->classparams['http_flist_file_between'];
434
+            $flist .= $f['md5sum'];
435
+            $addBR = false;
436
+            foreach ($f as $key=>$value) {
437
+                //If it's a specific key, let's display it:
438
+                if ($key !== 'name' && $key !== 'size' && $key !== 'relativePath' && $key !== 'fullName' && $key !== 'md5sum') {
439
+                    if ($addBR) {
440
+                        $flist .= "<br>";
441
+                    } else {
442
+                        // First line. We must add a new 'official' list separator.
443
+                        $flist .= $this->classparams['http_flist_file_between'];
444
+                        $addBR = true;
445
+                    }
446
+                    $flist .= "$key => $value";
447
+                }
448
+            }
449
+            $flist .= $this->classparams['http_flist_file_after'];
450
+    }
451
+    $flist .= $this->classparams['http_flist_end'];
452
+
453
+    return $flist;
454 454
 }
455 455
 
456 456
 /**
@@ -459,9 +459,9 @@  discard block
 block discarded – undo
459 459
  * See the tag_jscript and tag_applet class parameters.
460 460
  */
461 461
 private function generateAppletTag($str) {
462
-	$this->logDebug('generateAppletTag', 'Entering function');
463
-	$str = preg_replace('/'.$this->classparams['tag_jscript'].'/', $this->str_jsinit(), $str);
464
-	return preg_replace('/'.$this->classparams['tag_applet'].'/', $this->str_applet(), $str);
462
+    $this->logDebug('generateAppletTag', 'Entering function');
463
+    $str = preg_replace('/'.$this->classparams['tag_jscript'].'/', $this->str_jsinit(), $str);
464
+    return preg_replace('/'.$this->classparams['tag_applet'].'/', $this->str_applet(), $str);
465 465
 }
466 466
 
467 467
 /**
@@ -471,8 +471,8 @@  discard block
 block discarded – undo
471 471
  * This *must* be public, because it is called from PHP's output buffering
472 472
  */
473 473
 public function interceptBeforeUpload($str) {
474
-	$this->logDebug('interceptBeforeUpload', 'Entering function');
475
-	return $this->generateAppletTag($str);
474
+    $this->logDebug('interceptBeforeUpload', 'Entering function');
475
+    return $this->generateAppletTag($str);
476 476
 }
477 477
 
478 478
 /**
@@ -481,36 +481,36 @@  discard block
 block discarded – undo
481 481
  * This *must* be public, because it is called from PHP's output buffering.
482 482
  */
483 483
 public function interceptAfterUpload($str) {
484
-	$this->logDebug('interceptAfterUpload', 'Entering function');
485
-	$this->logPHPDebug('interceptAfterUpload', $this->files);
486
-
487
-	if (count($this->files) > 0) {
488
-		if (isset($this->classparams['callbackAfterUploadManagement'])) {
489
-			$this->logDebug('interceptAfterUpload', 'Before call of ' .$this->classparams['callbackAfterUploadManagement']);
490
-			$strForFListContent = call_user_func($this->classparams['callbackAfterUploadManagement'], $this, $this->files);
491
-		} else {
492
-			$strForFListContent = $this->defaultAfterUploadManagement();
493
-		}
494
-		$str = preg_replace('/'.$this->classparams['tag_flist'].'/', $strForFListContent, $str);
495
-	}
496
-	return $this->generateAppletTag($str);
484
+    $this->logDebug('interceptAfterUpload', 'Entering function');
485
+    $this->logPHPDebug('interceptAfterUpload', $this->files);
486
+
487
+    if (count($this->files) > 0) {
488
+        if (isset($this->classparams['callbackAfterUploadManagement'])) {
489
+            $this->logDebug('interceptAfterUpload', 'Before call of ' .$this->classparams['callbackAfterUploadManagement']);
490
+            $strForFListContent = call_user_func($this->classparams['callbackAfterUploadManagement'], $this, $this->files);
491
+        } else {
492
+            $strForFListContent = $this->defaultAfterUploadManagement();
493
+        }
494
+        $str = preg_replace('/'.$this->classparams['tag_flist'].'/', $strForFListContent, $str);
495
+    }
496
+    return $this->generateAppletTag($str);
497 497
 }
498 498
 
499 499
 /**
500 500
  * This method manages the receiving of the debug log, when an error occurs.
501 501
  */
502 502
 private function receive_debug_log() {
503
-	// handle error report
504
-	if (isset($_POST['description']) && isset($_POST['log'])) {
505
-		$msg = $_POST['log'];
506
-		mail($this->classparams['errormail'], $_POST['description'], $msg);
507
-	} else {
508
-		if (isset($_SERVER['SERVER_ADMIN']))
509
-		mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log',
503
+    // handle error report
504
+    if (isset($_POST['description']) && isset($_POST['log'])) {
505
+        $msg = $_POST['log'];
506
+        mail($this->classparams['errormail'], $_POST['description'], $msg);
507
+    } else {
508
+        if (isset($_SERVER['SERVER_ADMIN']))
509
+        mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log',
510 510
                     'An empty log has just been posted.');
511
-		$this->logPHPDebug('receive_debug_log', 'Empty error log received');
512
-	}
513
-	exit;
511
+        $this->logPHPDebug('receive_debug_log', 'Empty error log received');
512
+    }
513
+    exit;
514 514
 }
515 515
 
516 516
 /**
@@ -522,180 +522,180 @@  discard block
 block discarded – undo
522 522
  * Or you can Extend the class and redeclare defaultAfterUploadManagement() to your needs.
523 523
  */
524 524
 private function receive_uploaded_files() {
525
-	$this->logDebug('receive_uploaded_files', 'Entering POST management');
526
-
527
-	if (session_id() == '') {
528
-		session_start();
529
-	}
530
-	// we check for the session *after* handling possible error log
531
-	// because an error could have happened because the session-id is missing.
532
-	if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'size'])) {
533
-		$this->abort('Invalid session (in afterupload, POST, check of size)');
534
-	}
535
-	if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) {
536
-		$this->abort('Invalid session (in afterupload, POST, check of files)');
537
-	}
538
-	$this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files'];
539
-	if (!is_array($this->files)) {
540
-		$this->abort('Invalid session (in afterupload, POST, is_array(files))');
541
-	}
542
-	if ($this->appletparams['sendMD5Sum'] === 'true'  &&  !isset($_POST['md5sum'])) {
543
-		$this->abort('Required POST variable md5sum is missing');
544
-	}
545
-	$cnt = 0;
546
-	foreach ($_FILES as $key => $value) {
547
-		//Let's read the $_FILES data
548
-		if (isset($files_data)) {
549
-			unset($files_data);
550
-		}
551
-		$jupart			= (isset($_POST['jupart']))		 		? (int)$_POST['jupart']		: 0;
552
-		$jufinal		= (isset($_POST['jufinal']))	 		? (int)$_POST['jufinal']	: 1;
553
-		$relpaths		= (isset($_POST['relpathinfo'])) 	? $_POST['relpathinfo']		: null;
554
-		$md5sums		= (isset($_POST['md5sum']))				? $_POST['md5sum']				: null;
555
-		$mimetypes 	= (isset($_POST['mimetype'])) 	 	? $_POST['mimetype'] 			: null;
556
-		//$relpaths = (isset($_POST["relpathinfo$cnt"])) ? $_POST["relpathinfo$cnt"] : null;
557
-		//$md5sums = (isset($_POST["md5sum$cnt"])) ? $_POST["md5sum$cnt"] : null;
558
-
559
-		if (gettype($relpaths) === 'string') {
560
-			$relpaths = array($relpaths);
561
-		}
562
-		if (gettype($md5sums) === 'string') {
563
-			$md5sums = array($md5sums);
564
-		}
565
-		if ($this->appletparams['sendMD5Sum'] === 'true'  && !is_array($md5sums)) {
566
-			$this->abort('Expecting an array of MD5 checksums');
567
-		}
568
-		if (!is_array($relpaths)) {
569
-			$this->abort('Expecting an array of relative paths');
570
-		}
571
-		if (!is_array($mimetypes)) {
572
-			$this->abort('Expecting an array of MIME types');
573
-		}
574
-		// Check the MIME type (note: this is easily forged!)
575
-		if (isset($this->classparams['allowed_mime_types']) && is_array($this->classparams['allowed_mime_types'])) {
576
-			if (!in_array($mimetypes[$cnt], $this->classparams['allowed_mime_types'])) {
577
-				$this->abort('MIME type '.$mimetypes[$cnt].' not allowed');
578
-			}
579
-		}
580
-		if (isset($this->classparams['allowed_file_extensions']) && is_array($this->classparams['allowed_file_extensions'])) {
581
-			$fileExtension = substr(strrchr($value['name'][$cnt], "."), 1);
582
-			if (!in_array($fileExtension, $this->classparams['allowed_file_extensions'])) {
583
-				$this->abort('File extension '.$fileExtension.' not allowed');
584
-			}
585
-		}
586
-
587
-		$dstdir = $this->classparams['destdir'];
588
-		$dstname = $dstdir.'/'.$this->classparams['tmp_prefix'].session_id();
589
-		$tmpname = $dstdir.'/'.$this->classparams['tmp_prefix'].'tmp'.session_id();
590
-
591
-		// Controls are now done. Let's store the current uploaded files properties in an array, for future use.
592
-		$files_data['name']					= $value['name'][$cnt];
593
-		$files_data['size']					= 'not calculated yet';
594
-		$files_data['tmp_name']			= $value['tmp_name'][$cnt];
595
-		$files_data['error']    		= $value['error'][$cnt];
596
-		$files_data['relativePath'] = $relpaths[$cnt];
597
-		$files_data['md5sum']  			= $md5sums[$cnt];
598
-		$files_data['mimetype']  		= $mimetypes[$cnt];
599
-
600
-		if (!move_uploaded_file($files_data['tmp_name'], $tmpname)) {
601
-			if ($classparams['verbose_errors']) {
602
-				$this->abort("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)");
603
-		} else {
604
-			trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)",E_USER_WARNING);
605
-			$this->abort("Unable to move uploaded file");
606
-	}
525
+    $this->logDebug('receive_uploaded_files', 'Entering POST management');
526
+
527
+    if (session_id() == '') {
528
+        session_start();
529
+    }
530
+    // we check for the session *after* handling possible error log
531
+    // because an error could have happened because the session-id is missing.
532
+    if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'size'])) {
533
+        $this->abort('Invalid session (in afterupload, POST, check of size)');
534
+    }
535
+    if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) {
536
+        $this->abort('Invalid session (in afterupload, POST, check of files)');
537
+    }
538
+    $this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files'];
539
+    if (!is_array($this->files)) {
540
+        $this->abort('Invalid session (in afterupload, POST, is_array(files))');
541
+    }
542
+    if ($this->appletparams['sendMD5Sum'] === 'true'  &&  !isset($_POST['md5sum'])) {
543
+        $this->abort('Required POST variable md5sum is missing');
544
+    }
545
+    $cnt = 0;
546
+    foreach ($_FILES as $key => $value) {
547
+        //Let's read the $_FILES data
548
+        if (isset($files_data)) {
549
+            unset($files_data);
550
+        }
551
+        $jupart			= (isset($_POST['jupart']))		 		? (int)$_POST['jupart']		: 0;
552
+        $jufinal		= (isset($_POST['jufinal']))	 		? (int)$_POST['jufinal']	: 1;
553
+        $relpaths		= (isset($_POST['relpathinfo'])) 	? $_POST['relpathinfo']		: null;
554
+        $md5sums		= (isset($_POST['md5sum']))				? $_POST['md5sum']				: null;
555
+        $mimetypes 	= (isset($_POST['mimetype'])) 	 	? $_POST['mimetype'] 			: null;
556
+        //$relpaths = (isset($_POST["relpathinfo$cnt"])) ? $_POST["relpathinfo$cnt"] : null;
557
+        //$md5sums = (isset($_POST["md5sum$cnt"])) ? $_POST["md5sum$cnt"] : null;
558
+
559
+        if (gettype($relpaths) === 'string') {
560
+            $relpaths = array($relpaths);
561
+        }
562
+        if (gettype($md5sums) === 'string') {
563
+            $md5sums = array($md5sums);
564
+        }
565
+        if ($this->appletparams['sendMD5Sum'] === 'true'  && !is_array($md5sums)) {
566
+            $this->abort('Expecting an array of MD5 checksums');
567
+        }
568
+        if (!is_array($relpaths)) {
569
+            $this->abort('Expecting an array of relative paths');
570
+        }
571
+        if (!is_array($mimetypes)) {
572
+            $this->abort('Expecting an array of MIME types');
573
+        }
574
+        // Check the MIME type (note: this is easily forged!)
575
+        if (isset($this->classparams['allowed_mime_types']) && is_array($this->classparams['allowed_mime_types'])) {
576
+            if (!in_array($mimetypes[$cnt], $this->classparams['allowed_mime_types'])) {
577
+                $this->abort('MIME type '.$mimetypes[$cnt].' not allowed');
578
+            }
579
+        }
580
+        if (isset($this->classparams['allowed_file_extensions']) && is_array($this->classparams['allowed_file_extensions'])) {
581
+            $fileExtension = substr(strrchr($value['name'][$cnt], "."), 1);
582
+            if (!in_array($fileExtension, $this->classparams['allowed_file_extensions'])) {
583
+                $this->abort('File extension '.$fileExtension.' not allowed');
584
+            }
585
+        }
586
+
587
+        $dstdir = $this->classparams['destdir'];
588
+        $dstname = $dstdir.'/'.$this->classparams['tmp_prefix'].session_id();
589
+        $tmpname = $dstdir.'/'.$this->classparams['tmp_prefix'].'tmp'.session_id();
590
+
591
+        // Controls are now done. Let's store the current uploaded files properties in an array, for future use.
592
+        $files_data['name']					= $value['name'][$cnt];
593
+        $files_data['size']					= 'not calculated yet';
594
+        $files_data['tmp_name']			= $value['tmp_name'][$cnt];
595
+        $files_data['error']    		= $value['error'][$cnt];
596
+        $files_data['relativePath'] = $relpaths[$cnt];
597
+        $files_data['md5sum']  			= $md5sums[$cnt];
598
+        $files_data['mimetype']  		= $mimetypes[$cnt];
599
+
600
+        if (!move_uploaded_file($files_data['tmp_name'], $tmpname)) {
601
+            if ($classparams['verbose_errors']) {
602
+                $this->abort("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)");
603
+        } else {
604
+            trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)",E_USER_WARNING);
605
+            $this->abort("Unable to move uploaded file");
606
+    }
607 607
 }
608 608
 
609 609
 // In demo mode, no file storing is done. We just delete the newly uploaded file.
610 610
 if ($this->classparams['demo_mode']) {
611
-	if ($jufinal || (!$jupart)) {
612
-		if ($jupart) {
613
-			$files_data['size']		= ($jupart-1) * $this->appletparams['maxChunkSize'] + filesize($tmpname);
614
-		} else {
615
-			$files_data['size']		= filesize($tmpname);
616
-		}
617
-		$files_data['fullName']	= 'Demo mode<BR>No file storing';
618
-		array_push($this->files, $files_data);
619
-	}
620
-	unlink($tmpname);
621
-	$cnt++;
622
-	continue;
611
+    if ($jufinal || (!$jupart)) {
612
+        if ($jupart) {
613
+            $files_data['size']		= ($jupart-1) * $this->appletparams['maxChunkSize'] + filesize($tmpname);
614
+        } else {
615
+            $files_data['size']		= filesize($tmpname);
616
+        }
617
+        $files_data['fullName']	= 'Demo mode<BR>No file storing';
618
+        array_push($this->files, $files_data);
619
+    }
620
+    unlink($tmpname);
621
+    $cnt++;
622
+    continue;
623 623
 }
624 624
 //If we get here, the upload is a real one (no demo)
625 625
 if ($jupart) {
626
-	// got a chunk of a multi-part upload
627
-	$len = filesize($tmpname);
628
-	$_SESSION['RF'][$this->classparams['var_prefix'].'size'] += $len;
629
-	if ($len > 0) {
630
-		$src = fopen($tmpname, 'rb');
631
-		$dst = fopen($dstname, ($jupart == 1) ? 'wb' : 'ab');
632
-		while ($len > 0) {
633
-			$rlen = ($len > 8192) ? 8192 : $len;
634
-			$buf = fread($src, $rlen);
635
-			if (!$buf) {
636
-				fclose($src);
637
-				fclose($dst);
638
-				unlink($dstname);
639
-				$this->abort('read IO error');
640
-			}
641
-			if (!fwrite($dst, $buf, $rlen)) {
642
-				fclose($src);
643
-				fclose($dst);
644
-				unlink($dstname);
645
-				$this->abort('write IO error');
646
-			}
647
-			$len -= $rlen;
648
-		}
649
-		fclose($src);
650
-		fclose($dst);
651
-		unlink($tmpname);
652
-	}
653
-	if ($jufinal) {
654
-		// This is the last chunk. Check total lenght and
655
-		// rename it to it's final name.
656
-		$dlen = filesize($dstname);
657
-		if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size'])
658
-		$this->abort('file size mismatch');
659
-		if ($this->appletparams['sendMD5Sum'] === 'true' ) {
660
-			if ($md5sums[$cnt] != md5_file($dstname))
661
-			$this->abort('MD5 checksum mismatch');
662
-		}
663
-		// remove zero sized files
664
-		if (($dlen > 0) || $this->classparams['allow_zerosized']) {
665
-			$dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
666
-			if (!rename($dstname, $dstfinal))
667
-			$this->abort('rename IO error');
668
-			$_umask = umask(0); 	// override the system mask
669
-			if (!chmod($dstfinal, $this->classparams['fileperm']))
670
-				$this->abort('chmod IO error');
671
-			umask($_umask);
672
-			$files_data['size']		= filesize($dstfinal);
673
-			$files_data['fullName']	= $dstfinal;
674
-			$files_data['path']	= fix_dirname($dstfinal);
675
-			array_push($this->files, $files_data);
676
-		} else {
677
-			unlink($dstname);
678
-		}
679
-		// reset session var
680
-		$_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0;
681
-	}
626
+    // got a chunk of a multi-part upload
627
+    $len = filesize($tmpname);
628
+    $_SESSION['RF'][$this->classparams['var_prefix'].'size'] += $len;
629
+    if ($len > 0) {
630
+        $src = fopen($tmpname, 'rb');
631
+        $dst = fopen($dstname, ($jupart == 1) ? 'wb' : 'ab');
632
+        while ($len > 0) {
633
+            $rlen = ($len > 8192) ? 8192 : $len;
634
+            $buf = fread($src, $rlen);
635
+            if (!$buf) {
636
+                fclose($src);
637
+                fclose($dst);
638
+                unlink($dstname);
639
+                $this->abort('read IO error');
640
+            }
641
+            if (!fwrite($dst, $buf, $rlen)) {
642
+                fclose($src);
643
+                fclose($dst);
644
+                unlink($dstname);
645
+                $this->abort('write IO error');
646
+            }
647
+            $len -= $rlen;
648
+        }
649
+        fclose($src);
650
+        fclose($dst);
651
+        unlink($tmpname);
652
+    }
653
+    if ($jufinal) {
654
+        // This is the last chunk. Check total lenght and
655
+        // rename it to it's final name.
656
+        $dlen = filesize($dstname);
657
+        if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size'])
658
+        $this->abort('file size mismatch');
659
+        if ($this->appletparams['sendMD5Sum'] === 'true' ) {
660
+            if ($md5sums[$cnt] != md5_file($dstname))
661
+            $this->abort('MD5 checksum mismatch');
662
+        }
663
+        // remove zero sized files
664
+        if (($dlen > 0) || $this->classparams['allow_zerosized']) {
665
+            $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
666
+            if (!rename($dstname, $dstfinal))
667
+            $this->abort('rename IO error');
668
+            $_umask = umask(0); 	// override the system mask
669
+            if (!chmod($dstfinal, $this->classparams['fileperm']))
670
+                $this->abort('chmod IO error');
671
+            umask($_umask);
672
+            $files_data['size']		= filesize($dstfinal);
673
+            $files_data['fullName']	= $dstfinal;
674
+            $files_data['path']	= fix_dirname($dstfinal);
675
+            array_push($this->files, $files_data);
676
+        } else {
677
+            unlink($dstname);
678
+        }
679
+        // reset session var
680
+        $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0;
681
+    }
682 682
 } else {
683
-	// Got a single file upload. Trivial.
684
-	if ($this->appletparams['sendMD5Sum'] === 'true' ) {
685
-		if ($md5sums[$cnt] != md5_file($tmpname))
686
-			$this->abort('MD5 checksum mismatch');
687
-	}
688
-	$dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
689
-	if (!rename($tmpname, $dstfinal))
690
-	$this->abort('rename IO error');
691
-	$_umask = umask(0); 	// override the system mask
692
-	if (!chmod($dstfinal, $this->classparams['fileperm']))
693
-		$this->abort('chmod IO error');
694
-	umask($_umask);
695
-	$files_data['size']		= filesize($dstfinal);
696
-	$files_data['fullName']	= $dstfinal;
697
-	$files_data['path']	= fix_dirname($dstfinal);
698
-	array_push($this->files, $files_data);
683
+    // Got a single file upload. Trivial.
684
+    if ($this->appletparams['sendMD5Sum'] === 'true' ) {
685
+        if ($md5sums[$cnt] != md5_file($tmpname))
686
+            $this->abort('MD5 checksum mismatch');
687
+    }
688
+    $dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
689
+    if (!rename($tmpname, $dstfinal))
690
+    $this->abort('rename IO error');
691
+    $_umask = umask(0); 	// override the system mask
692
+    if (!chmod($dstfinal, $this->classparams['fileperm']))
693
+        $this->abort('chmod IO error');
694
+    umask($_umask);
695
+    $files_data['size']		= filesize($dstfinal);
696
+    $files_data['fullName']	= $dstfinal;
697
+    $files_data['path']	= fix_dirname($dstfinal);
698
+    array_push($this->files, $files_data);
699 699
 }
700 700
 $cnt++;
701 701
 }
@@ -711,56 +711,56 @@  discard block
 block discarded – undo
711 711
  *
712 712
  */
713 713
 private function page_start() {
714
-	$this->logDebug('page_start', 'Entering function');
715
-
716
-	// If the applet checks for the serverProtocol, it issues a HEAD request
717
-	// -> Simply return an empty doc.
718
-	if ($_SERVER['REQUEST_METHOD'] === 'HEAD') {
719
-		// Nothing to do
720
-
721
-	} else if ($_SERVER['REQUEST_METHOD'] === 'GET') {
722
-		// A GET request means: return upload page
723
-		$this->logDebug('page_start', 'Entering GET management');
724
-
725
-		if (session_id() == '') {
726
-			session_start();
727
-		}
728
-		if (isset($_GET['afterupload'])) {
729
-			$this->logDebug('page_start', 'afterupload is set');
730
-			if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) {
731
-				$this->abort('Invalid session (in afterupload, GET, check of $_SESSION["RF"]): files array is not set');
732
-			}
733
-			$this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files'];
734
-			if (!is_array($this->files)) {
735
-				$this->abort('Invalid session (in afterupload, GET, check of is_array(files)): files is not an array');
736
-			}
737
-			// clear session data ready for new upload
738
-			$_SESSION['RF'][$this->classparams['var_prefix'].'files'] = array();
739
-
740
-			// start intercepting the content of the calling page, to display the upload result.
741
-			ob_start(array(& $this, 'interceptAfterUpload'));
742
-
743
-		} else {
744
-			$this->logDebug('page_start', 'afterupload is not set');
745
-			if ($this->classparams['session_regenerate']) {
746
-				session_regenerate_id(true);
747
-			}
748
-			$this->files = array();
749
-			$_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0;
750
-			$_SESSION['RF'][$this->classparams['var_prefix'].'files'] = $this->files;
751
-			// start intercepting the content of the calling page, to display the applet tag.
752
-			ob_start(array(& $this, 'interceptBeforeUpload'));
753
-		}
754
-
755
-	} else if ($_SERVER['REQUEST_METHOD'] === 'POST') {
756
-		// If we got a POST request, this is the real work.
757
-		if (isset($_GET['errormail'])) {
758
-			//Hum, an error occurs on server side. Let's manage the debug log, that we just received.
759
-			$this->receive_debug_log();
760
-		} else {
761
-			$this->receive_uploaded_files();
762
-		}
763
-	}
714
+    $this->logDebug('page_start', 'Entering function');
715
+
716
+    // If the applet checks for the serverProtocol, it issues a HEAD request
717
+    // -> Simply return an empty doc.
718
+    if ($_SERVER['REQUEST_METHOD'] === 'HEAD') {
719
+        // Nothing to do
720
+
721
+    } else if ($_SERVER['REQUEST_METHOD'] === 'GET') {
722
+        // A GET request means: return upload page
723
+        $this->logDebug('page_start', 'Entering GET management');
724
+
725
+        if (session_id() == '') {
726
+            session_start();
727
+        }
728
+        if (isset($_GET['afterupload'])) {
729
+            $this->logDebug('page_start', 'afterupload is set');
730
+            if (!isset($_SESSION['RF'][$this->classparams['var_prefix'].'files'])) {
731
+                $this->abort('Invalid session (in afterupload, GET, check of $_SESSION["RF"]): files array is not set');
732
+            }
733
+            $this->files = $_SESSION['RF'][$this->classparams['var_prefix'].'files'];
734
+            if (!is_array($this->files)) {
735
+                $this->abort('Invalid session (in afterupload, GET, check of is_array(files)): files is not an array');
736
+            }
737
+            // clear session data ready for new upload
738
+            $_SESSION['RF'][$this->classparams['var_prefix'].'files'] = array();
739
+
740
+            // start intercepting the content of the calling page, to display the upload result.
741
+            ob_start(array(& $this, 'interceptAfterUpload'));
742
+
743
+        } else {
744
+            $this->logDebug('page_start', 'afterupload is not set');
745
+            if ($this->classparams['session_regenerate']) {
746
+                session_regenerate_id(true);
747
+            }
748
+            $this->files = array();
749
+            $_SESSION['RF'][$this->classparams['var_prefix'].'size'] = 0;
750
+            $_SESSION['RF'][$this->classparams['var_prefix'].'files'] = $this->files;
751
+            // start intercepting the content of the calling page, to display the applet tag.
752
+            ob_start(array(& $this, 'interceptBeforeUpload'));
753
+        }
754
+
755
+    } else if ($_SERVER['REQUEST_METHOD'] === 'POST') {
756
+        // If we got a POST request, this is the real work.
757
+        if (isset($_GET['errormail'])) {
758
+            //Hum, an error occurs on server side. Let's manage the debug log, that we just received.
759
+            $this->receive_debug_log();
760
+        } else {
761
+            $this->receive_uploaded_files();
762
+        }
763
+    }
764 764
 }
765 765
 }
766 766
 
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
 		// set some defaults for the applet params
68 68
 		if (!isset($appletparams['afterUploadURL']))
69
-		$appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1';
69
+		$appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'].'?afterupload=1';
70 70
 		if (!isset($appletparams['name']))
71 71
 		$appletparams['name'] = 'JUpload';
72 72
 		if (!isset($appletparams['archive']))
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$appletparams['maxFileSize'] = $maxfs;
108 108
 		$appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']);
109 109
 		if (isset($classparams['errormail'])) {
110
-			$appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail';
110
+			$appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"].'?errormail';
111 111
 		}
112 112
 
113 113
 		// Same for class parameters
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
 			$classparams['destdir'] = $obd;
149 149
 			else
150 150
 			$classparams['destdir'] = '/var/tmp/jupload_test';
151
-		}else{
152
-			$classparams['destdir']=str_replace('~',' ',$classparams['destdir']);
151
+		} else {
152
+			$classparams['destdir'] = str_replace('~', ' ', $classparams['destdir']);
153 153
 		}
154 154
 		if ($classparams['create_destdir']) {
155
-			$_umask = umask(0); 	// override the system mask
155
+			$_umask = umask(0); // override the system mask
156 156
 			@mkdir($classparams['destdir'], $classparams['dirperm']);
157 157
 			umask($_umask);
158 158
 		}
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 	/**
199 199
 	 * Log a message on the current output, as a HTML comment.
200 200
 	 */
201
-	protected function logDebug($function, $msg, $htmlComment=true) {
201
+	protected function logDebug($function, $msg, $htmlComment = true) {
202 202
 		$output = "[DEBUG] [$function] $msg";
203 203
 		if ($htmlComment) {
204 204
 			echo("<!-- $output -->\r\n");
@@ -237,8 +237,8 @@  discard block
 block discarded – undo
237 237
 	 */
238 238
 	private function tobytes($val) {
239 239
 		$val = trim($val);
240
-		$last = fix_strtolower($val{strlen($val)-1});
241
-		switch($last) {
240
+		$last = fix_strtolower($val{strlen($val) - 1});
241
+		switch ($last) {
242 242
 			case 'g':
243 243
 				$val *= 1024;
244 244
 			case 'm':
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 	private function abort($msg = '') {
311 311
 		$this->cleanup();
312 312
 		if ($msg != '')
313
-		die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n");
313
+		die(str_replace('(.*)', $msg, $this->appletparams['stringUploadError'])."\n");
314 314
 		exit;
315 315
 	}
316 316
 
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
 		foreach ($dirs as $dir) {
344 344
 			$path .= '/'.$dir;
345 345
 			if (!file_exists($path)) {  // @ does NOT always supress the error!
346
-				$_umask = umask(0); 	// override the system mask
346
+				$_umask = umask(0); // override the system mask
347 347
 				@mkdir($path, $this->classparams['dirperm']);
348 348
 				umask($_umask);
349 349
 			}
@@ -364,10 +364,10 @@  discard block
 block discarded – undo
364 364
 	private function dstfinal(&$name, &$subdir) {
365 365
 		$name = preg_replace('![`$\\\\/|]!', '_', $name);
366 366
 		if ($this->classparams['allow_subdirs'] && ($subdir != '')) {
367
-			$subdir = trim(preg_replace('!\\\\!','/',$subdir),'/');
367
+			$subdir = trim(preg_replace('!\\\\!', '/', $subdir), '/');
368 368
 			$subdir = preg_replace('![`$|]!', '_', $subdir);
369 369
 			if (!$this->classparams['spaces_in_subdirs']) {
370
-				$subdir = str_replace(' ','_',$subdir);
370
+				$subdir = str_replace(' ', '_', $subdir);
371 371
 			}
372 372
 			// recursively create subdir
373 373
 			if (!$this->classparams['demo_mode'])
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 *
418 418
 	 */
419 419
 	public function defaultAfterUploadManagement() {
420
-		$flist = '[defaultAfterUploadManagement] Nb uploaded files is: ' . sizeof($this->files);
420
+		$flist = '[defaultAfterUploadManagement] Nb uploaded files is: '.sizeof($this->files);
421 421
 		$flist = $this->classparams['http_flist_start'];
422 422
 		foreach ($this->files as $f) {
423 423
 			//$f is an array, that contains all info about the uploaded file.
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 
487 487
 	if (count($this->files) > 0) {
488 488
 		if (isset($this->classparams['callbackAfterUploadManagement'])) {
489
-			$this->logDebug('interceptAfterUpload', 'Before call of ' .$this->classparams['callbackAfterUploadManagement']);
489
+			$this->logDebug('interceptAfterUpload', 'Before call of '.$this->classparams['callbackAfterUploadManagement']);
490 490
 			$strForFListContent = call_user_func($this->classparams['callbackAfterUploadManagement'], $this, $this->files);
491 491
 		} else {
492 492
 			$strForFListContent = $this->defaultAfterUploadManagement();
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 	if (!is_array($this->files)) {
540 540
 		$this->abort('Invalid session (in afterupload, POST, is_array(files))');
541 541
 	}
542
-	if ($this->appletparams['sendMD5Sum'] === 'true'  &&  !isset($_POST['md5sum'])) {
542
+	if ($this->appletparams['sendMD5Sum'] === 'true' && !isset($_POST['md5sum'])) {
543 543
 		$this->abort('Required POST variable md5sum is missing');
544 544
 	}
545 545
 	$cnt = 0;
@@ -548,11 +548,11 @@  discard block
 block discarded – undo
548 548
 		if (isset($files_data)) {
549 549
 			unset($files_data);
550 550
 		}
551
-		$jupart			= (isset($_POST['jupart']))		 		? (int)$_POST['jupart']		: 0;
552
-		$jufinal		= (isset($_POST['jufinal']))	 		? (int)$_POST['jufinal']	: 1;
553
-		$relpaths		= (isset($_POST['relpathinfo'])) 	? $_POST['relpathinfo']		: null;
554
-		$md5sums		= (isset($_POST['md5sum']))				? $_POST['md5sum']				: null;
555
-		$mimetypes 	= (isset($_POST['mimetype'])) 	 	? $_POST['mimetype'] 			: null;
551
+		$jupart			= (isset($_POST['jupart'])) ? (int)$_POST['jupart'] : 0;
552
+		$jufinal		= (isset($_POST['jufinal'])) ? (int)$_POST['jufinal'] : 1;
553
+		$relpaths = (isset($_POST['relpathinfo'])) ? $_POST['relpathinfo'] : null;
554
+		$md5sums		= (isset($_POST['md5sum'])) ? $_POST['md5sum'] : null;
555
+		$mimetypes = (isset($_POST['mimetype'])) ? $_POST['mimetype'] : null;
556 556
 		//$relpaths = (isset($_POST["relpathinfo$cnt"])) ? $_POST["relpathinfo$cnt"] : null;
557 557
 		//$md5sums = (isset($_POST["md5sum$cnt"])) ? $_POST["md5sum$cnt"] : null;
558 558
 
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 		if (gettype($md5sums) === 'string') {
563 563
 			$md5sums = array($md5sums);
564 564
 		}
565
-		if ($this->appletparams['sendMD5Sum'] === 'true'  && !is_array($md5sums)) {
565
+		if ($this->appletparams['sendMD5Sum'] === 'true' && !is_array($md5sums)) {
566 566
 			$this->abort('Expecting an array of MD5 checksums');
567 567
 		}
568 568
 		if (!is_array($relpaths)) {
@@ -595,13 +595,13 @@  discard block
 block discarded – undo
595 595
 		$files_data['error']    		= $value['error'][$cnt];
596 596
 		$files_data['relativePath'] = $relpaths[$cnt];
597 597
 		$files_data['md5sum']  			= $md5sums[$cnt];
598
-		$files_data['mimetype']  		= $mimetypes[$cnt];
598
+		$files_data['mimetype'] = $mimetypes[$cnt];
599 599
 
600 600
 		if (!move_uploaded_file($files_data['tmp_name'], $tmpname)) {
601 601
 			if ($classparams['verbose_errors']) {
602 602
 				$this->abort("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)");
603 603
 		} else {
604
-			trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)",E_USER_WARNING);
604
+			trigger_error("Unable to move uploaded file (from ${files_data['tmp_name']} to $tmpname)", E_USER_WARNING);
605 605
 			$this->abort("Unable to move uploaded file");
606 606
 	}
607 607
 }
@@ -610,11 +610,11 @@  discard block
 block discarded – undo
610 610
 if ($this->classparams['demo_mode']) {
611 611
 	if ($jufinal || (!$jupart)) {
612 612
 		if ($jupart) {
613
-			$files_data['size']		= ($jupart-1) * $this->appletparams['maxChunkSize'] + filesize($tmpname);
613
+			$files_data['size']		= ($jupart - 1) * $this->appletparams['maxChunkSize'] + filesize($tmpname);
614 614
 		} else {
615 615
 			$files_data['size']		= filesize($tmpname);
616 616
 		}
617
-		$files_data['fullName']	= 'Demo mode<BR>No file storing';
617
+		$files_data['fullName'] = 'Demo mode<BR>No file storing';
618 618
 		array_push($this->files, $files_data);
619 619
 	}
620 620
 	unlink($tmpname);
@@ -656,22 +656,22 @@  discard block
 block discarded – undo
656 656
 		$dlen = filesize($dstname);
657 657
 		if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size'])
658 658
 		$this->abort('file size mismatch');
659
-		if ($this->appletparams['sendMD5Sum'] === 'true' ) {
659
+		if ($this->appletparams['sendMD5Sum'] === 'true') {
660 660
 			if ($md5sums[$cnt] != md5_file($dstname))
661 661
 			$this->abort('MD5 checksum mismatch');
662 662
 		}
663 663
 		// remove zero sized files
664 664
 		if (($dlen > 0) || $this->classparams['allow_zerosized']) {
665
-			$dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
665
+			$dstfinal = $this->dstfinal($files_data['name'], $files_data['relativePath']);
666 666
 			if (!rename($dstname, $dstfinal))
667 667
 			$this->abort('rename IO error');
668
-			$_umask = umask(0); 	// override the system mask
668
+			$_umask = umask(0); // override the system mask
669 669
 			if (!chmod($dstfinal, $this->classparams['fileperm']))
670 670
 				$this->abort('chmod IO error');
671 671
 			umask($_umask);
672
-			$files_data['size']		= filesize($dstfinal);
673
-			$files_data['fullName']	= $dstfinal;
674
-			$files_data['path']	= fix_dirname($dstfinal);
672
+			$files_data['size'] = filesize($dstfinal);
673
+			$files_data['fullName'] = $dstfinal;
674
+			$files_data['path'] = fix_dirname($dstfinal);
675 675
 			array_push($this->files, $files_data);
676 676
 		} else {
677 677
 			unlink($dstname);
@@ -681,20 +681,20 @@  discard block
 block discarded – undo
681 681
 	}
682 682
 } else {
683 683
 	// Got a single file upload. Trivial.
684
-	if ($this->appletparams['sendMD5Sum'] === 'true' ) {
684
+	if ($this->appletparams['sendMD5Sum'] === 'true') {
685 685
 		if ($md5sums[$cnt] != md5_file($tmpname))
686 686
 			$this->abort('MD5 checksum mismatch');
687 687
 	}
688
-	$dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
688
+	$dstfinal = $this->dstfinal($files_data['name'], $files_data['relativePath']);
689 689
 	if (!rename($tmpname, $dstfinal))
690 690
 	$this->abort('rename IO error');
691
-	$_umask = umask(0); 	// override the system mask
691
+	$_umask = umask(0); // override the system mask
692 692
 	if (!chmod($dstfinal, $this->classparams['fileperm']))
693 693
 		$this->abort('chmod IO error');
694 694
 	umask($_umask);
695
-	$files_data['size']		= filesize($dstfinal);
696
-	$files_data['fullName']	= $dstfinal;
697
-	$files_data['path']	= fix_dirname($dstfinal);
695
+	$files_data['size'] = filesize($dstfinal);
696
+	$files_data['fullName'] = $dstfinal;
697
+	$files_data['path'] = fix_dirname($dstfinal);
698 698
 	array_push($this->files, $files_data);
699 699
 }
700 700
 $cnt++;
Please login to merge, or discard this patch.
Braces   +168 added lines, -109 removed lines patch added patch discarded remove patch
@@ -59,34 +59,47 @@  discard block
 block discarded – undo
59 59
 	var $files;
60 60
 
61 61
 	public function JUpload($appletparams = array(), $classparams = array()) {
62
-		if (gettype($classparams) !== 'array')
63
-		$this->abort('Invalid type of parameter classparams: Expecting an array');
64
-		if (gettype($appletparams) !== 'array')
65
-		$this->abort('Invalid type of parameter appletparams: Expecting an array');
62
+		if (gettype($classparams) !== 'array') {
63
+				$this->abort('Invalid type of parameter classparams: Expecting an array');
64
+		}
65
+		if (gettype($appletparams) !== 'array') {
66
+				$this->abort('Invalid type of parameter appletparams: Expecting an array');
67
+		}
66 68
 
67 69
 		// set some defaults for the applet params
68
-		if (!isset($appletparams['afterUploadURL']))
69
-		$appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1';
70
-		if (!isset($appletparams['name']))
71
-		$appletparams['name'] = 'JUpload';
72
-		if (!isset($appletparams['archive']))
73
-		$appletparams['archive'] = 'wjhk.jupload.jar';
74
-		if (!isset($appletparams['code']))
75
-		$appletparams['code'] = 'wjhk.jupload2.JUploadApplet';
76
-		if (!isset($appletparams['debugLevel']))
77
-		$appletparams['debugLevel'] = 0;
78
-		if (!isset($appletparams['httpUploadParameterType']))
79
-		$appletparams['httpUploadParameterType'] = 'array';
80
-		if (!isset($appletparams['showLogWindow']))
81
-		$appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false';
82
-		if (!isset($appletparams['width']))
83
-		$appletparams['width'] = 640;
84
-		if (!isset($appletparams['height']))
85
-		$appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300;
86
-		if (!isset($appletparams['mayscript']))
87
-		$appletparams['mayscript'] = 'true';
88
-		if (!isset($appletparams['scriptable']))
89
-		$appletparams['scriptable'] = 'false';
70
+		if (!isset($appletparams['afterUploadURL'])) {
71
+				$appletparams['afterUploadURL'] = $_SERVER['PHP_SELF'] . '?afterupload=1';
72
+		}
73
+		if (!isset($appletparams['name'])) {
74
+				$appletparams['name'] = 'JUpload';
75
+		}
76
+		if (!isset($appletparams['archive'])) {
77
+				$appletparams['archive'] = 'wjhk.jupload.jar';
78
+		}
79
+		if (!isset($appletparams['code'])) {
80
+				$appletparams['code'] = 'wjhk.jupload2.JUploadApplet';
81
+		}
82
+		if (!isset($appletparams['debugLevel'])) {
83
+				$appletparams['debugLevel'] = 0;
84
+		}
85
+		if (!isset($appletparams['httpUploadParameterType'])) {
86
+				$appletparams['httpUploadParameterType'] = 'array';
87
+		}
88
+		if (!isset($appletparams['showLogWindow'])) {
89
+				$appletparams['showLogWindow'] = ($appletparams['debugLevel'] > 0) ? 'true' : 'false';
90
+		}
91
+		if (!isset($appletparams['width'])) {
92
+				$appletparams['width'] = 640;
93
+		}
94
+		if (!isset($appletparams['height'])) {
95
+				$appletparams['height'] = ($appletparams['showLogWindow'] === 'true') ? 500 : 300;
96
+		}
97
+		if (!isset($appletparams['mayscript'])) {
98
+				$appletparams['mayscript'] = 'true';
99
+		}
100
+		if (!isset($appletparams['scriptable'])) {
101
+				$appletparams['scriptable'] = 'false';
102
+		}
90 103
 		//if (!isset($appletparams['stringUploadSuccess']))
91 104
 		$appletparams['stringUploadSuccess'] = 'SUCCESS';
92 105
 		//if (!isset($appletparams['stringUploadError']))
@@ -103,52 +116,71 @@  discard block
 block discarded – undo
103 116
 			$appletparams['maxChunkSize'] = $optchunk;
104 117
 		}
105 118
 		$appletparams['maxChunkSize'] = $this->tobytes($appletparams['maxChunkSize']);
106
-		if (!isset($appletparams['maxFileSize']))
107
-		$appletparams['maxFileSize'] = $maxfs;
119
+		if (!isset($appletparams['maxFileSize'])) {
120
+				$appletparams['maxFileSize'] = $maxfs;
121
+		}
108 122
 		$appletparams['maxFileSize'] = $this->tobytes($appletparams['maxFileSize']);
109 123
 		if (isset($classparams['errormail'])) {
110 124
 			$appletparams['urlToSendErrorTo'] = $_SERVER["PHP_SELF"] . '?errormail';
111 125
 		}
112 126
 
113 127
 		// Same for class parameters
114
-		if (!isset($classparams['demo_mode']))
115
-		$classparams['demo_mode'] = false;
128
+		if (!isset($classparams['demo_mode'])) {
129
+				$classparams['demo_mode'] = false;
130
+		}
116 131
 		if ($classparams['demo_mode']) {
117 132
 			$classparams['create_destdir'] = false;
118 133
 			$classparams['allow_subdirs'] = true;
119 134
 			$classparams['allow_zerosized'] = true;
120 135
 			$classparams['duplicate'] = 'overwrite';
121 136
 		}
122
-		if (!isset($classparams['debug_php']))											// set true to log some messages in PHP log
137
+		if (!isset($classparams['debug_php'])) {
138
+		    // set true to log some messages in PHP log
123 139
 		$classparams['debug_php'] = false;
124
-		if (!isset($this->classparams['allowed_mime_types']))				// array of allowed MIME type
140
+		}
141
+		if (!isset($this->classparams['allowed_mime_types'])) {
142
+		    // array of allowed MIME type
125 143
 		$classparams['allowed_mime_types'] = 'all';
126
-		if (!isset($this->classparams['allowed_file_extensions'])) 	// array of allowed file extensions
144
+		}
145
+		if (!isset($this->classparams['allowed_file_extensions'])) {
146
+		    // array of allowed file extensions
127 147
 		$classparams['allowed_file_extensions'] = 'all';
128
-		if (!isset($classparams['verbose_errors']))						// shouldn't display server info on a production site!
148
+		}
149
+		if (!isset($classparams['verbose_errors'])) {
150
+		    // shouldn't display server info on a production site!
129 151
 		$classparams['verbose_errors'] = true;
130
-		if (!isset($classparams['session_regenerate']))
131
-		$classparams['session_regenerate'] = false;
132
-		if (!isset($classparams['create_destdir']))
133
-		$classparams['create_destdir'] = true;
134
-		if (!isset($classparams['allow_subdirs']))
135
-		$classparams['allow_subdirs'] = false;
136
-		if (!isset($classparams['spaces_in_subdirs']))
137
-		$classparams['spaces_in_subdirs'] = false;
138
-		if (!isset($classparams['allow_zerosized']))
139
-		$classparams['allow_zerosized'] = false;
140
-		if (!isset($classparams['duplicate']))
141
-		$classparams['duplicate'] = 'rename';
142
-		if (!isset($classparams['dirperm']))
143
-		$classparams['dirperm'] = 0755;
144
-		if (!isset($classparams['fileperm']))
145
-		$classparams['fileperm'] = 0644;
152
+		}
153
+		if (!isset($classparams['session_regenerate'])) {
154
+				$classparams['session_regenerate'] = false;
155
+		}
156
+		if (!isset($classparams['create_destdir'])) {
157
+				$classparams['create_destdir'] = true;
158
+		}
159
+		if (!isset($classparams['allow_subdirs'])) {
160
+				$classparams['allow_subdirs'] = false;
161
+		}
162
+		if (!isset($classparams['spaces_in_subdirs'])) {
163
+				$classparams['spaces_in_subdirs'] = false;
164
+		}
165
+		if (!isset($classparams['allow_zerosized'])) {
166
+				$classparams['allow_zerosized'] = false;
167
+		}
168
+		if (!isset($classparams['duplicate'])) {
169
+				$classparams['duplicate'] = 'rename';
170
+		}
171
+		if (!isset($classparams['dirperm'])) {
172
+				$classparams['dirperm'] = 0755;
173
+		}
174
+		if (!isset($classparams['fileperm'])) {
175
+				$classparams['fileperm'] = 0644;
176
+		}
146 177
 		if (!isset($classparams['destdir'])) {
147
-			if ($obd != '')
148
-			$classparams['destdir'] = $obd;
149
-			else
150
-			$classparams['destdir'] = '/var/tmp/jupload_test';
151
-		}else{
178
+			if ($obd != '') {
179
+						$classparams['destdir'] = $obd;
180
+			} else {
181
+						$classparams['destdir'] = '/var/tmp/jupload_test';
182
+			}
183
+		} else{
152 184
 			$classparams['destdir']=str_replace('~',' ',$classparams['destdir']);
153 185
 		}
154 186
 		if ($classparams['create_destdir']) {
@@ -156,31 +188,43 @@  discard block
 block discarded – undo
156 188
 			@mkdir($classparams['destdir'], $classparams['dirperm']);
157 189
 			umask($_umask);
158 190
 		}
159
-		if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir']))
160
-		$this->abort('Destination dir not accessible');
161
-		if (!isset($classparams['tmp_prefix']))
162
-		$classparams['tmp_prefix'] = 'jutmp.';
163
-		if (!isset($classparams['var_prefix']))
164
-		$classparams['var_prefix'] = 'juvar.';
165
-		if (!isset($classparams['jscript_wrapper']))
166
-		$classparams['jscript_wrapper'] = 'JUploadSetProperty';
167
-		if (!isset($classparams['tag_jscript']))
168
-		$classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->';
169
-		if (!isset($classparams['tag_applet']))
170
-		$classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->';
171
-		if (!isset($classparams['tag_flist']))
172
-		$classparams['tag_flist'] = '<!--JUPLOAD_FILES-->';
173
-		if (!isset($classparams['http_flist_start']))
174
-		$classparams['http_flist_start'] =
191
+		if (!is_dir($classparams['destdir']) && is_writable($classparams['destdir'])) {
192
+				$this->abort('Destination dir not accessible');
193
+		}
194
+		if (!isset($classparams['tmp_prefix'])) {
195
+				$classparams['tmp_prefix'] = 'jutmp.';
196
+		}
197
+		if (!isset($classparams['var_prefix'])) {
198
+				$classparams['var_prefix'] = 'juvar.';
199
+		}
200
+		if (!isset($classparams['jscript_wrapper'])) {
201
+				$classparams['jscript_wrapper'] = 'JUploadSetProperty';
202
+		}
203
+		if (!isset($classparams['tag_jscript'])) {
204
+				$classparams['tag_jscript'] = '<!--JUPLOAD_JSCRIPT-->';
205
+		}
206
+		if (!isset($classparams['tag_applet'])) {
207
+				$classparams['tag_applet'] = '<!--JUPLOAD_APPLET-->';
208
+		}
209
+		if (!isset($classparams['tag_flist'])) {
210
+				$classparams['tag_flist'] = '<!--JUPLOAD_FILES-->';
211
+		}
212
+		if (!isset($classparams['http_flist_start'])) {
213
+				$classparams['http_flist_start'] =
175 214
             		"<table border='1'><TR><TH>Filename</TH><TH>file size</TH><TH>Relative path</TH><TH>Full name</TH><TH>md5sum</TH><TH>Specific parameters</TH></TR>";
176
-		if (!isset($classparams['http_flist_end']))
177
-		$classparams['http_flist_end'] = "</table>\n";
178
-		if (!isset($classparams['http_flist_file_before']))
179
-		$classparams['http_flist_file_before'] = "<tr><td>";
180
-		if (!isset($classparams['http_flist_file_between']))
181
-		$classparams['http_flist_file_between'] = "</td><td>";
182
-		if (!isset($classparams['http_flist_file_after']))
183
-		$classparams['http_flist_file_after'] = "</td></tr>\n";
215
+		}
216
+		if (!isset($classparams['http_flist_end'])) {
217
+				$classparams['http_flist_end'] = "</table>\n";
218
+		}
219
+		if (!isset($classparams['http_flist_file_before'])) {
220
+				$classparams['http_flist_file_before'] = "<tr><td>";
221
+		}
222
+		if (!isset($classparams['http_flist_file_between'])) {
223
+				$classparams['http_flist_file_between'] = "</td><td>";
224
+		}
225
+		if (!isset($classparams['http_flist_file_after'])) {
226
+				$classparams['http_flist_file_after'] = "</td></tr>\n";
227
+		}
184 228
 
185 229
 		$this->appletparams = $appletparams;
186 230
 		$this->classparams = $classparams;
@@ -289,14 +333,16 @@  discard block
 block discarded – undo
289 333
 		$ret .= '  height = "'.$params['height'].'"'.$N;
290 334
 		$ret .= '  name = "'.$params['name'].'">'.$N;
291 335
 		foreach ($params as $key => $val) {
292
-			if ($key !== 'width' && $key !== 'height')
293
-			$ret .= '  <param name = "'.$key.'" value = "'.$val.'" />'.$N;
336
+			if ($key !== 'width' && $key !== 'height') {
337
+						$ret .= '  <param name = "'.$key.'" value = "'.$val.'" />'.$N;
338
+			}
294 339
 		}
295 340
 		$ret .= '  <comment>'.$N;
296 341
 		$ret .= '    <embed'.$N;
297 342
 		$ret .= '      type = "application/x-java-applet;version=1.5"'.$N;
298
-		foreach ($params as $key => $val)
299
-		$ret .= '      '.$key.' = "'.$val.'"'.$N;
343
+		foreach ($params as $key => $val) {
344
+				$ret .= '      '.$key.' = "'.$val.'"'.$N;
345
+		}
300 346
 		$ret .= '      pluginspage = "http://java.sun.com/products/plugin/index.html#download">'.$N;
301 347
 		$ret .= '      <noembed>'.$N;
302 348
 		$ret .= '        Java 1.5 or higher plugin required.'.$N;
@@ -309,15 +355,17 @@  discard block
 block discarded – undo
309 355
 
310 356
 	private function abort($msg = '') {
311 357
 		$this->cleanup();
312
-		if ($msg != '')
313
-		die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n");
358
+		if ($msg != '') {
359
+				die(str_replace('(.*)',$msg,$this->appletparams['stringUploadError'])."\n");
360
+		}
314 361
 		exit;
315 362
 	}
316 363
 
317 364
 	private function warning($msg = '') {
318 365
 		$this->cleanup();
319
-		if ($msg != '')
320
-		echo('WARNING: '.$msg."\n");
366
+		if ($msg != '') {
367
+				echo('WARNING: '.$msg."\n");
368
+		}
321 369
 		echo $this->appletparams['stringUploadSuccess']."\n";
322 370
 		exit;
323 371
 	}
@@ -325,8 +373,9 @@  discard block
 block discarded – undo
325 373
 	private function cleanup() {
326 374
 		// remove all uploaded files of *this* request
327 375
 		if (isset($_FILES)) {
328
-			foreach ($_FILES as $key => $val)
329
-			@unlink($val['tmp_name']);
376
+			foreach ($_FILES as $key => $val) {
377
+						@unlink($val['tmp_name']);
378
+			}
330 379
 		}
331 380
 		// remove accumulated file, if any.
332 381
 		@unlink($this->classparams['destdir'].'/'.$this->classparams['tmp_prefix'].session_id());
@@ -348,8 +397,9 @@  discard block
 block discarded – undo
348 397
 				umask($_umask);
349 398
 			}
350 399
 		}
351
-		if (!is_dir($path) && is_writable($path))
352
-		$this->abort('Destination dir not accessible');
400
+		if (!is_dir($path) && is_writable($path)) {
401
+				$this->abort('Destination dir not accessible');
402
+		}
353 403
 	}
354 404
 
355 405
 	/**
@@ -370,8 +420,9 @@  discard block
 block discarded – undo
370 420
 				$subdir = str_replace(' ','_',$subdir);
371 421
 			}
372 422
 			// recursively create subdir
373
-			if (!$this->classparams['demo_mode'])
374
-			$this->mkdirp($subdir);
423
+			if (!$this->classparams['demo_mode']) {
424
+						$this->mkdirp($subdir);
425
+			}
375 426
 			// append a slash
376 427
 			$subdir .= '/';
377 428
 		} else {
@@ -505,9 +556,10 @@  discard block
 block discarded – undo
505 556
 		$msg = $_POST['log'];
506 557
 		mail($this->classparams['errormail'], $_POST['description'], $msg);
507 558
 	} else {
508
-		if (isset($_SERVER['SERVER_ADMIN']))
509
-		mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log',
559
+		if (isset($_SERVER['SERVER_ADMIN'])) {
560
+				mail($_SERVER['SERVER_ADMIN'], 'Empty jupload error log',
510 561
                     'An empty log has just been posted.');
562
+		}
511 563
 		$this->logPHPDebug('receive_debug_log', 'Empty error log received');
512 564
 	}
513 565
 	exit;
@@ -654,20 +706,24 @@  discard block
 block discarded – undo
654 706
 		// This is the last chunk. Check total lenght and
655 707
 		// rename it to it's final name.
656 708
 		$dlen = filesize($dstname);
657
-		if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size'])
658
-		$this->abort('file size mismatch');
709
+		if ($dlen != $_SESSION['RF'][$this->classparams['var_prefix'].'size']) {
710
+				$this->abort('file size mismatch');
711
+		}
659 712
 		if ($this->appletparams['sendMD5Sum'] === 'true' ) {
660
-			if ($md5sums[$cnt] != md5_file($dstname))
661
-			$this->abort('MD5 checksum mismatch');
713
+			if ($md5sums[$cnt] != md5_file($dstname)) {
714
+						$this->abort('MD5 checksum mismatch');
715
+			}
662 716
 		}
663 717
 		// remove zero sized files
664 718
 		if (($dlen > 0) || $this->classparams['allow_zerosized']) {
665 719
 			$dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
666
-			if (!rename($dstname, $dstfinal))
667
-			$this->abort('rename IO error');
720
+			if (!rename($dstname, $dstfinal)) {
721
+						$this->abort('rename IO error');
722
+			}
668 723
 			$_umask = umask(0); 	// override the system mask
669
-			if (!chmod($dstfinal, $this->classparams['fileperm']))
670
-				$this->abort('chmod IO error');
724
+			if (!chmod($dstfinal, $this->classparams['fileperm'])) {
725
+							$this->abort('chmod IO error');
726
+			}
671 727
 			umask($_umask);
672 728
 			$files_data['size']		= filesize($dstfinal);
673 729
 			$files_data['fullName']	= $dstfinal;
@@ -682,15 +738,18 @@  discard block
 block discarded – undo
682 738
 } else {
683 739
 	// Got a single file upload. Trivial.
684 740
 	if ($this->appletparams['sendMD5Sum'] === 'true' ) {
685
-		if ($md5sums[$cnt] != md5_file($tmpname))
686
-			$this->abort('MD5 checksum mismatch');
741
+		if ($md5sums[$cnt] != md5_file($tmpname)) {
742
+					$this->abort('MD5 checksum mismatch');
743
+		}
687 744
 	}
688 745
 	$dstfinal = $this->dstfinal($files_data['name'],$files_data['relativePath']);
689
-	if (!rename($tmpname, $dstfinal))
690
-	$this->abort('rename IO error');
746
+	if (!rename($tmpname, $dstfinal)) {
747
+		$this->abort('rename IO error');
748
+	}
691 749
 	$_umask = umask(0); 	// override the system mask
692
-	if (!chmod($dstfinal, $this->classparams['fileperm']))
693
-		$this->abort('chmod IO error');
750
+	if (!chmod($dstfinal, $this->classparams['fileperm'])) {
751
+			$this->abort('chmod IO error');
752
+	}
694 753
 	umask($_umask);
695 754
 	$files_data['size']		= filesize($dstfinal);
696 755
 	$files_data['fullName']	= $dstfinal;
Please login to merge, or discard this patch.
xoopseditor/tinymce4/external_plugins/filemanager/uploader/success.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
     <style>
6 6
 	body{padding:0px; margin:0px;}
7 7
     </style>
8
-    <meta http-equiv="refresh" content="3;url=index.php?path=<?php echo strip_tags(preg_replace( "/[^a-zA-Z0-9\.\[\]_| -]/", '',$_GET['path'])); ?>">
8
+    <meta http-equiv="refresh" content="3;url=index.php?path=<?php echo strip_tags(preg_replace("/[^a-zA-Z0-9\.\[\]_| -]/", '', $_GET['path'])); ?>">
9 9
   </head>
10 10
   <body>
11 11
     <center><br/><br/>
Please login to merge, or discard this patch.
class/xoopseditor/tinymce4/external_plugins/filemanager/uploader/index.php 3 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
     if($path==$current_path)  $cycle=false;
18 18
     
19 19
     if(file_exists($path."config.php")){
20
-	require_once($path."config.php");
21
-	$cycle=false;
20
+    require_once($path."config.php");
21
+    $cycle=false;
22 22
     }
23 23
     $path=fix_dirname($path)."/";
24 24
 }
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
  * @param $file The array wich contains info about all uploaded files.
45 45
  */
46 46
 function handle_uploaded_files($juploadPhpSupportClass, $files) {
47
-	return
48
-		"<P>We are in the 'handle_uploaded_files' callback function, in the index.php script. To avoid double coding, we "
49
-		. "just call the default behavior of the JUpload PHP class. Just replace this by your code...</P>"
50
-		. $juploadPhpSupportClass->defaultAfterUploadManagement();
51
-		;
47
+    return
48
+        "<P>We are in the 'handle_uploaded_files' callback function, in the index.php script. To avoid double coding, we "
49
+        . "just call the default behavior of the JUpload PHP class. Just replace this by your code...</P>"
50
+        . $juploadPhpSupportClass->defaultAfterUploadManagement();
51
+        ;
52 52
 
53 53
 }
54 54
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 // see all details http://jupload.sourceforge.net/howto-customization.html
66 66
 //
67 67
 $appletParameters = array(
68
-		//Default value is ... maximum size for a file on the current FS. 2G is problably too much already.
68
+        //Default value is ... maximum size for a file on the current FS. 2G is problably too much already.
69 69
         'maxFileSize' => $JAVAMaxSizeUpload.'G',
70 70
         //
71 71
         //In the sourceforge project structure, the applet jar file is one folder below. Default
72 72
         //configuration is ok, if wjhk.jupload.jar is in the same folder as the script containing this call.
73 73
         'archive' => 'wjhk.jupload.jar',
74
-	'showLogWindow' => 'false',
75
-	'width' => '100%',
76
-	'height' =>'358px',
77
-	'name' => 'No limit Uploader',
78
-	'allowedFileExtensions' => implode('/',$ext),
74
+    'showLogWindow' => 'false',
75
+    'width' => '100%',
76
+    'height' =>'358px',
77
+    'name' => 'No limit Uploader',
78
+    'allowedFileExtensions' => implode('/',$ext),
79 79
         //To manage, other jar files, like the ftp jar files if postURL is an FTP URL:
80 80
         //'archive' => 'wjhk.jupload.jar,jakarta-commons-oro.jar,jakarta-commons-net.jar',
81 81
         //
@@ -94,13 +94,13 @@  discard block
 block discarded – undo
94 94
 // for htaccess protected folders 
95 95
 if((isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != '') && $_SERVER['PHP_AUTH_USER'] != '' && $_SERVER['PHP_AUTH_USER'] != '') 
96 96
 {
97
-	$appletParameters['specificHeaders'] = 'Authorization: Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']);
97
+    $appletParameters['specificHeaders'] = 'Authorization: Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']);
98 98
 }
99 99
 
100 100
 //
101 101
 //Then: the jupload PHP class parameters
102 102
 $classParameters = array(
103
-		//Files won't be stored on the server. Useful for first tests of the applet behavior ... and sourceforge demo site !
103
+        //Files won't be stored on the server. Useful for first tests of the applet behavior ... and sourceforge demo site !
104 104
         'demo_mode' => false,
105 105
         //
106 106
         //Allow creation of subdirectories, when uploading several folders/files (drag and drop a folder on the applet to use it).
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,33 +1,33 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include '../config/config.php';
4
-if(!$java_upload) die('forbidden');
5
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbidden');
4
+if (!$java_upload) die('forbidden');
5
+if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbidden');
6 6
 
7 7
 //Let's load the 'interesting' stuff ...  ;-)
8 8
 include 'jupload.php';
9 9
 include '../include/utils.php';
10 10
 
11
-$path=$current_path.$_GET['path'];
12
-$cycle=true;
13
-$max_cycles=50;
14
-$i=0;
15
-while($cycle && $i<$max_cycles){
11
+$path = $current_path.$_GET['path'];
12
+$cycle = true;
13
+$max_cycles = 50;
14
+$i = 0;
15
+while ($cycle && $i < $max_cycles) {
16 16
     $i++;
17
-    if($path==$current_path)  $cycle=false;
17
+    if ($path == $current_path)  $cycle = false;
18 18
     
19
-    if(file_exists($path."config.php")){
19
+    if (file_exists($path."config.php")) {
20 20
 	require_once($path."config.php");
21
-	$cycle=false;
21
+	$cycle = false;
22 22
     }
23
-    $path=fix_dirname($path)."/";
23
+    $path = fix_dirname($path)."/";
24 24
 }
25 25
 
26
-$path="../".$current_path.$_GET['path'];
26
+$path = "../".$current_path.$_GET['path'];
27 27
 
28
-if(strpos($_GET['path'],'../')!==FALSE || strpos($_GET['path'],'./')!==FALSE || strpos($_GET['path'],'/')===0) die ('path error');
28
+if (strpos($_GET['path'], '../') !== FALSE || strpos($_GET['path'], './') !== FALSE || strpos($_GET['path'], '/') === 0) die ('path error');
29 29
 
30
-$path=str_replace(' ','~',$path);
30
+$path = str_replace(' ', '~', $path);
31 31
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
32 32
 ///////////////   The user callback function, that can be called after upload   ////////////////////////
33 33
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	'width' => '100%',
76 76
 	'height' =>'358px',
77 77
 	'name' => 'No limit Uploader',
78
-	'allowedFileExtensions' => implode('/',$ext),
78
+	'allowedFileExtensions' => implode('/', $ext),
79 79
         //To manage, other jar files, like the ftp jar files if postURL is an FTP URL:
80 80
         //'archive' => 'wjhk.jupload.jar,jakarta-commons-oro.jar,jakarta-commons-net.jar',
81 81
         //
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     );
93 93
 
94 94
 // for htaccess protected folders 
95
-if((isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != '') && $_SERVER['PHP_AUTH_USER'] != '' && $_SERVER['PHP_AUTH_USER'] != '') 
95
+if ((isset($_SERVER['PHP_AUTH_USER']) && $_SERVER['PHP_AUTH_USER'] != '') && $_SERVER['PHP_AUTH_USER'] != '' && $_SERVER['PHP_AUTH_USER'] != '') 
96 96
 {
97 97
 	$appletParameters['specificHeaders'] = 'Authorization: Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].":".$_SERVER['PHP_AUTH_PW']);
98 98
 }
Please login to merge, or discard this patch.
Braces   +12 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include '../config/config.php';
4
-if(!$java_upload) die('forbidden');
5
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbidden');
4
+if(!$java_upload) {
5
+    die('forbidden');
6
+}
7
+if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") {
8
+    die('forbidden');
9
+}
6 10
 
7 11
 //Let's load the 'interesting' stuff ...  ;-)
8 12
 include 'jupload.php';
@@ -14,7 +18,9 @@  discard block
 block discarded – undo
14 18
 $i=0;
15 19
 while($cycle && $i<$max_cycles){
16 20
     $i++;
17
-    if($path==$current_path)  $cycle=false;
21
+    if($path==$current_path) {
22
+        $cycle=false;
23
+    }
18 24
     
19 25
     if(file_exists($path."config.php")){
20 26
 	require_once($path."config.php");
@@ -25,7 +31,9 @@  discard block
 block discarded – undo
25 31
 
26 32
 $path="../".$current_path.$_GET['path'];
27 33
 
28
-if(strpos($_GET['path'],'../')!==FALSE || strpos($_GET['path'],'./')!==FALSE || strpos($_GET['path'],'/')===0) die ('path error');
34
+if(strpos($_GET['path'],'../')!==FALSE || strpos($_GET['path'],'./')!==FALSE || strpos($_GET['path'],'/')===0) {
35
+    die ('path error');
36
+}
29 37
 
30 38
 $path=str_replace(' ','~',$path);
31 39
 ////////////////////////////////////////////////////////////////////////////////////////////////////////
Please login to merge, or discard this patch.
class/xoopseditor/tinymce4/external_plugins/filemanager/ajax_calls.php 3 patches
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -5,137 +5,137 @@  discard block
 block discarded – undo
5 5
 include('include/utils.php');
6 6
 
7 7
 if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])){
8
-	include($_SESSION['RF']['language_file']);
8
+    include($_SESSION['RF']['language_file']);
9 9
 }
10 10
 else {
11
-	die('Language file is missing!');
11
+    die('Language file is missing!');
12 12
 }
13 13
 
14 14
 if(isset($_GET['action'])) 
15 15
 {
16 16
     switch($_GET['action']) 
17 17
     {
18
-		case 'view':
19
-		    if(isset($_GET['type'])) {
20
-				$_SESSION['RF']["view_type"] = $_GET['type'];
21
-			}
22
-			else {
23
-				die('view type number missing');
24
-			}
25
-			break;
26
-		case 'sort':
27
-			if(isset($_GET['sort_by'])) {
28
-				$_SESSION['RF']["sort_by"] = $_GET['sort_by'];
29
-			}
18
+        case 'view':
19
+            if(isset($_GET['type'])) {
20
+                $_SESSION['RF']["view_type"] = $_GET['type'];
21
+            }
22
+            else {
23
+                die('view type number missing');
24
+            }
25
+            break;
26
+        case 'sort':
27
+            if(isset($_GET['sort_by'])) {
28
+                $_SESSION['RF']["sort_by"] = $_GET['sort_by'];
29
+            }
30 30
 			
31
-			if(isset($_GET['descending'])) {
32
-				$_SESSION['RF']["descending"] = $_GET['descending'] === "TRUE";
33
-			}
34
-			break;
35
-		case 'image_size': // not used
36
-	    	$pos = strpos($_POST['path'],$upload_dir);
37
-			if ($pos !== FALSE) 
38
-			{
39
-				$info=getimagesize(substr_replace($_POST['path'],$current_path,$pos,strlen($upload_dir)));
40
-				echo json_encode($info);
41
-			}
42
-	    	break;
43
-		case 'save_img':
44
-		    $info=pathinfo($_POST['name']);
31
+            if(isset($_GET['descending'])) {
32
+                $_SESSION['RF']["descending"] = $_GET['descending'] === "TRUE";
33
+            }
34
+            break;
35
+        case 'image_size': // not used
36
+            $pos = strpos($_POST['path'],$upload_dir);
37
+            if ($pos !== FALSE) 
38
+            {
39
+                $info=getimagesize(substr_replace($_POST['path'],$current_path,$pos,strlen($upload_dir)));
40
+                echo json_encode($info);
41
+            }
42
+            break;
43
+        case 'save_img':
44
+            $info=pathinfo($_POST['name']);
45 45
 
46
-		    if (strpos($_POST['path'], '/') === 0
47
-			|| strpos($_POST['path'], '../') !== FALSE
48
-			|| strpos($_POST['path'], './') === 0
49
-			|| strpos($_POST['url'], 'http://featherfiles.aviary.com/') !== 0
50
-			|| $_POST['name'] != fix_filename($_POST['name'], $transliteration)
51
-			|| !in_array(strtolower($info['extension']), array('jpg','jpeg','png')))
52
-		    {
53
-			    die('wrong data');
54
-			}
46
+            if (strpos($_POST['path'], '/') === 0
47
+            || strpos($_POST['path'], '../') !== FALSE
48
+            || strpos($_POST['path'], './') === 0
49
+            || strpos($_POST['url'], 'http://featherfiles.aviary.com/') !== 0
50
+            || $_POST['name'] != fix_filename($_POST['name'], $transliteration)
51
+            || !in_array(strtolower($info['extension']), array('jpg','jpeg','png')))
52
+            {
53
+                die('wrong data');
54
+            }
55 55
 
56
-		    $image_data = get_file_by_url($_POST['url']);
57
-		    if ($image_data === FALSE) 
58
-		    {
59
-		        die(lang_Aviary_No_Save);
60
-		    }
56
+            $image_data = get_file_by_url($_POST['url']);
57
+            if ($image_data === FALSE) 
58
+            {
59
+                die(lang_Aviary_No_Save);
60
+            }
61 61
 
62
-		    file_put_contents($current_path.$_POST['path'].$_POST['name'],$image_data);
62
+            file_put_contents($current_path.$_POST['path'].$_POST['name'],$image_data);
63 63
 
64
-		    create_img_gd($current_path.$_POST['path'].$_POST['name'], $thumbs_base_path.$_POST['path'].$_POST['name'], 122, 91);
65
-		    // TODO something with this function cause its blowing my mind
66
-		    new_thumbnails_creation($current_path.$_POST['path'],$current_path.$_POST['path'].$_POST['name'],$_POST['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
67
-		    break;
68
-		case 'extract':
69
-		    if(strpos($_POST['path'],'/')===0 || strpos($_POST['path'],'../')!==FALSE || strpos($_POST['path'],'./')===0) {
70
-				die('wrong path');
71
-			}
64
+            create_img_gd($current_path.$_POST['path'].$_POST['name'], $thumbs_base_path.$_POST['path'].$_POST['name'], 122, 91);
65
+            // TODO something with this function cause its blowing my mind
66
+            new_thumbnails_creation($current_path.$_POST['path'],$current_path.$_POST['path'].$_POST['name'],$_POST['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
67
+            break;
68
+        case 'extract':
69
+            if(strpos($_POST['path'],'/')===0 || strpos($_POST['path'],'../')!==FALSE || strpos($_POST['path'],'./')===0) {
70
+                die('wrong path');
71
+            }
72 72
 
73
-		    $path = $current_path.$_POST['path'];
74
-		    $info = pathinfo($path);
75
-		    $base_folder = $current_path.fix_dirname($_POST['path'])."/";
73
+            $path = $current_path.$_POST['path'];
74
+            $info = pathinfo($path);
75
+            $base_folder = $current_path.fix_dirname($_POST['path'])."/";
76 76
 
77
-		    switch($info['extension'])
78
-		    {
79
-				case "zip":
80
-				    $zip = new ZipArchive;
81
-				    if ($zip->open($path) === TRUE) {
82
-						//make all the folders
83
-						for($i = 0; $i < $zip->numFiles; $i++) 
84
-						{ 
85
-						    $OnlyFileName = $zip->getNameIndex($i);
86
-						    $FullFileName = $zip->statIndex($i);    
87
-						    if (substr($FullFileName['name'], -1, 1) ==="/")
88
-						    {
89
-								create_folder($base_folder.$FullFileName['name']);
90
-						    }
91
-						}
92
-						//unzip into the folders
93
-						for($i = 0; $i < $zip->numFiles; $i++) 
94
-						{ 
95
-						    $OnlyFileName = $zip->getNameIndex($i);
96
-						    $FullFileName = $zip->statIndex($i);    
77
+            switch($info['extension'])
78
+            {
79
+                case "zip":
80
+                    $zip = new ZipArchive;
81
+                    if ($zip->open($path) === TRUE) {
82
+                        //make all the folders
83
+                        for($i = 0; $i < $zip->numFiles; $i++) 
84
+                        { 
85
+                            $OnlyFileName = $zip->getNameIndex($i);
86
+                            $FullFileName = $zip->statIndex($i);    
87
+                            if (substr($FullFileName['name'], -1, 1) ==="/")
88
+                            {
89
+                                create_folder($base_folder.$FullFileName['name']);
90
+                            }
91
+                        }
92
+                        //unzip into the folders
93
+                        for($i = 0; $i < $zip->numFiles; $i++) 
94
+                        { 
95
+                            $OnlyFileName = $zip->getNameIndex($i);
96
+                            $FullFileName = $zip->statIndex($i);    
97 97
 					    
98
-						    if (!(substr($FullFileName['name'], -1, 1) ==="/"))
99
-						    {
100
-								$fileinfo = pathinfo($OnlyFileName);
101
-								if(in_array(strtolower($fileinfo['extension']),$ext))
102
-								{
103
-								    copy('zip://'. $path .'#'. $OnlyFileName , $base_folder.$FullFileName['name'] ); 
104
-								} 
105
-						    }
106
-						}
107
-						$zip->close();
108
-				    }
109
-				    else {
110
-						die(lang_Zip_No_Extract);
111
-				    }
98
+                            if (!(substr($FullFileName['name'], -1, 1) ==="/"))
99
+                            {
100
+                                $fileinfo = pathinfo($OnlyFileName);
101
+                                if(in_array(strtolower($fileinfo['extension']),$ext))
102
+                                {
103
+                                    copy('zip://'. $path .'#'. $OnlyFileName , $base_folder.$FullFileName['name'] ); 
104
+                                } 
105
+                            }
106
+                        }
107
+                        $zip->close();
108
+                    }
109
+                    else {
110
+                        die(lang_Zip_No_Extract);
111
+                    }
112 112
 
113
-				    break;
113
+                    break;
114 114
 
115
-				case "gz":
116
-				    $p = new PharData($path);
117
-				    $p->decompress(); // creates files.tar
115
+                case "gz":
116
+                    $p = new PharData($path);
117
+                    $p->decompress(); // creates files.tar
118 118
 
119
-				    break;
119
+                    break;
120 120
 
121
-				case "tar":
122
-				    // unarchive from the tar
123
-				    $phar = new PharData($path);
124
-				    $phar->decompressFiles();
125
-				    $files = array();
126
-				    check_files_extensions_on_phar( $phar, $files, '', $ext );
127
-				    $phar->extractTo( $current_path.fix_dirname( $_POST['path'] )."/", $files, TRUE );
121
+                case "tar":
122
+                    // unarchive from the tar
123
+                    $phar = new PharData($path);
124
+                    $phar->decompressFiles();
125
+                    $files = array();
126
+                    check_files_extensions_on_phar( $phar, $files, '', $ext );
127
+                    $phar->extractTo( $current_path.fix_dirname( $_POST['path'] )."/", $files, TRUE );
128 128
 
129
-				    break;
129
+                    break;
130 130
 
131
-				default:
132
-					die(lang_Zip_Invalid);
133
-		    }
134
-		    break;
135
-		case 'media_preview':    
136
-			$preview_file = $_GET["file"];
137
-			$info = pathinfo($preview_file);
138
-			?>
131
+                default:
132
+                    die(lang_Zip_Invalid);
133
+            }
134
+            break;
135
+        case 'media_preview':    
136
+            $preview_file = $_GET["file"];
137
+            $info = pathinfo($preview_file);
138
+            ?>
139 139
 			<div id="jp_container_1" class="jp-video " style="margin:0 auto;">
140 140
 			    <div class="jp-type-single">
141 141
 			      <div id="jquery_jplayer_1" class="jp-jplayer"></div>
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 			    </div>
185 185
 			  </div>
186 186
 			<?php
187
-			if(in_array(strtolower($info['extension']), $ext_music)) {
188
-			?>
187
+            if(in_array(strtolower($info['extension']), $ext_music)) {
188
+            ?>
189 189
 
190 190
 				<script type="text/javascript">
191 191
 				    $(document).ready(function(){
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
 				  </script>
211 211
 
212 212
 			<?php
213
-			} elseif(in_array(strtolower($info['extension']), $ext_video)) {
214
-			?>
213
+            } elseif(in_array(strtolower($info['extension']), $ext_video)) {
214
+            ?>
215 215
 			    
216 216
 			    <script type="text/javascript">
217 217
 			    $(document).ready(function(){
@@ -235,63 +235,63 @@  discard block
 block discarded – undo
235 235
 			  </script>
236 236
 			    
237 237
 			<?php
238
-			}
239
-			break;
240
-		case 'copy_cut':
241
-			if ($_POST['sub_action'] !== 'copy' && $_POST['sub_action'] !== 'cut') {
242
-				die('wrong sub-action');
243
-			}
238
+            }
239
+            break;
240
+        case 'copy_cut':
241
+            if ($_POST['sub_action'] !== 'copy' && $_POST['sub_action'] !== 'cut') {
242
+                die('wrong sub-action');
243
+            }
244 244
 
245
-			if (trim($_POST['path']) == '' || trim($_POST['path_thumb']) == '') {
246
-				die('no path');
247
-			}
245
+            if (trim($_POST['path']) == '' || trim($_POST['path_thumb']) == '') {
246
+                die('no path');
247
+            }
248 248
 
249
-			$path = $current_path.$_POST['path'];
250
-		    $info = pathinfo($path);
251
-		    $base_folder = $current_path.fix_dirname($_POST['path'])."/";
249
+            $path = $current_path.$_POST['path'];
250
+            $info = pathinfo($path);
251
+            $base_folder = $current_path.fix_dirname($_POST['path'])."/";
252 252
 
253
-			if (is_dir($path))
254
-			{
255
-				// can't copy/cut dirs
256
-				if ($copy_cut_dirs === FALSE){
257
-					die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Folders));
258
-				}
253
+            if (is_dir($path))
254
+            {
255
+                // can't copy/cut dirs
256
+                if ($copy_cut_dirs === FALSE){
257
+                    die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Folders));
258
+                }
259 259
 
260
-				// size over limit
261
-				if ($copy_cut_max_size !== FALSE && is_int($copy_cut_max_size)){
262
-					if (($copy_cut_max_size * 1024 * 1024) < foldersize($path)){
263
-						die(sprintf(lang_Copy_Cut_Size_Limit, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_size));
264
-					}
265
-				}
260
+                // size over limit
261
+                if ($copy_cut_max_size !== FALSE && is_int($copy_cut_max_size)){
262
+                    if (($copy_cut_max_size * 1024 * 1024) < foldersize($path)){
263
+                        die(sprintf(lang_Copy_Cut_Size_Limit, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_size));
264
+                    }
265
+                }
266 266
 
267
-				// file count over limit
268
-				if ($copy_cut_max_count !== FALSE && is_int($copy_cut_max_count)){
269
-					if ($copy_cut_max_count < filescount($path)){
270
-						die(sprintf(lang_Copy_Cut_Count_Limit, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_count));
271
-					}
272
-				}
273
-			}
274
-			else {
275
-				// can't copy/cut files
276
-				if ($copy_cut_files === FALSE){
277
-					die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Files));
278
-				}
279
-			}
267
+                // file count over limit
268
+                if ($copy_cut_max_count !== FALSE && is_int($copy_cut_max_count)){
269
+                    if ($copy_cut_max_count < filescount($path)){
270
+                        die(sprintf(lang_Copy_Cut_Count_Limit, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_count));
271
+                    }
272
+                }
273
+            }
274
+            else {
275
+                // can't copy/cut files
276
+                if ($copy_cut_files === FALSE){
277
+                    die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Files));
278
+                }
279
+            }
280 280
 
281
-			$_SESSION['RF']['clipboard']['path'] = $path;
282
-			$_SESSION['RF']['clipboard']['path_thumb'] = $_POST['path_thumb'];
283
-			$_SESSION['RF']['clipboard_action'] = $_POST['sub_action'];
284
-			break;
285
-		case 'clear_clipboard':
286
-			$_SESSION['RF']['clipboard'] = NULL;
287
-			$_SESSION['RF']['clipboard_action'] = NULL;
288
-			break;
289
-	    default: die('no action passed');
281
+            $_SESSION['RF']['clipboard']['path'] = $path;
282
+            $_SESSION['RF']['clipboard']['path_thumb'] = $_POST['path_thumb'];
283
+            $_SESSION['RF']['clipboard_action'] = $_POST['sub_action'];
284
+            break;
285
+        case 'clear_clipboard':
286
+            $_SESSION['RF']['clipboard'] = NULL;
287
+            $_SESSION['RF']['clipboard_action'] = NULL;
288
+            break;
289
+        default: die('no action passed');
290 290
     }
291 291
 }
292 292
 else 
293 293
 {
294
-	die('no action passed');
294
+    die('no action passed');
295 295
 }
296 296
 
297 297
 ?>
298 298
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include('config/config.php');
4
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('Access Denied!');
4
+if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('Access Denied!');
5 5
 include('include/utils.php');
6 6
 
7
-if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])){
7
+if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])) {
8 8
 	include($_SESSION['RF']['language_file']);
9 9
 }
10 10
 else {
11 11
 	die('Language file is missing!');
12 12
 }
13 13
 
14
-if(isset($_GET['action'])) 
14
+if (isset($_GET['action'])) 
15 15
 {
16
-    switch($_GET['action']) 
16
+    switch ($_GET['action']) 
17 17
     {
18 18
 		case 'view':
19
-		    if(isset($_GET['type'])) {
19
+		    if (isset($_GET['type'])) {
20 20
 				$_SESSION['RF']["view_type"] = $_GET['type'];
21 21
 			}
22 22
 			else {
@@ -24,31 +24,31 @@  discard block
 block discarded – undo
24 24
 			}
25 25
 			break;
26 26
 		case 'sort':
27
-			if(isset($_GET['sort_by'])) {
27
+			if (isset($_GET['sort_by'])) {
28 28
 				$_SESSION['RF']["sort_by"] = $_GET['sort_by'];
29 29
 			}
30 30
 			
31
-			if(isset($_GET['descending'])) {
31
+			if (isset($_GET['descending'])) {
32 32
 				$_SESSION['RF']["descending"] = $_GET['descending'] === "TRUE";
33 33
 			}
34 34
 			break;
35 35
 		case 'image_size': // not used
36
-	    	$pos = strpos($_POST['path'],$upload_dir);
36
+	    	$pos = strpos($_POST['path'], $upload_dir);
37 37
 			if ($pos !== FALSE) 
38 38
 			{
39
-				$info=getimagesize(substr_replace($_POST['path'],$current_path,$pos,strlen($upload_dir)));
39
+				$info = getimagesize(substr_replace($_POST['path'], $current_path, $pos, strlen($upload_dir)));
40 40
 				echo json_encode($info);
41 41
 			}
42 42
 	    	break;
43 43
 		case 'save_img':
44
-		    $info=pathinfo($_POST['name']);
44
+		    $info = pathinfo($_POST['name']);
45 45
 
46 46
 		    if (strpos($_POST['path'], '/') === 0
47 47
 			|| strpos($_POST['path'], '../') !== FALSE
48 48
 			|| strpos($_POST['path'], './') === 0
49 49
 			|| strpos($_POST['url'], 'http://featherfiles.aviary.com/') !== 0
50 50
 			|| $_POST['name'] != fix_filename($_POST['name'], $transliteration)
51
-			|| !in_array(strtolower($info['extension']), array('jpg','jpeg','png')))
51
+			|| !in_array(strtolower($info['extension']), array('jpg', 'jpeg', 'png')))
52 52
 		    {
53 53
 			    die('wrong data');
54 54
 			}
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
 		        die(lang_Aviary_No_Save);
60 60
 		    }
61 61
 
62
-		    file_put_contents($current_path.$_POST['path'].$_POST['name'],$image_data);
62
+		    file_put_contents($current_path.$_POST['path'].$_POST['name'], $image_data);
63 63
 
64 64
 		    create_img_gd($current_path.$_POST['path'].$_POST['name'], $thumbs_base_path.$_POST['path'].$_POST['name'], 122, 91);
65 65
 		    // TODO something with this function cause its blowing my mind
66
-		    new_thumbnails_creation($current_path.$_POST['path'],$current_path.$_POST['path'].$_POST['name'],$_POST['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height);
66
+		    new_thumbnails_creation($current_path.$_POST['path'], $current_path.$_POST['path'].$_POST['name'], $_POST['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height);
67 67
 		    break;
68 68
 		case 'extract':
69
-		    if(strpos($_POST['path'],'/')===0 || strpos($_POST['path'],'../')!==FALSE || strpos($_POST['path'],'./')===0) {
69
+		    if (strpos($_POST['path'], '/') === 0 || strpos($_POST['path'], '../') !== FALSE || strpos($_POST['path'], './') === 0) {
70 70
 				die('wrong path');
71 71
 			}
72 72
 
@@ -74,33 +74,33 @@  discard block
 block discarded – undo
74 74
 		    $info = pathinfo($path);
75 75
 		    $base_folder = $current_path.fix_dirname($_POST['path'])."/";
76 76
 
77
-		    switch($info['extension'])
77
+		    switch ($info['extension'])
78 78
 		    {
79 79
 				case "zip":
80 80
 				    $zip = new ZipArchive;
81 81
 				    if ($zip->open($path) === TRUE) {
82 82
 						//make all the folders
83
-						for($i = 0; $i < $zip->numFiles; $i++) 
83
+						for ($i = 0; $i < $zip->numFiles; $i++) 
84 84
 						{ 
85 85
 						    $OnlyFileName = $zip->getNameIndex($i);
86 86
 						    $FullFileName = $zip->statIndex($i);    
87
-						    if (substr($FullFileName['name'], -1, 1) ==="/")
87
+						    if (substr($FullFileName['name'], -1, 1) === "/")
88 88
 						    {
89 89
 								create_folder($base_folder.$FullFileName['name']);
90 90
 						    }
91 91
 						}
92 92
 						//unzip into the folders
93
-						for($i = 0; $i < $zip->numFiles; $i++) 
93
+						for ($i = 0; $i < $zip->numFiles; $i++) 
94 94
 						{ 
95 95
 						    $OnlyFileName = $zip->getNameIndex($i);
96 96
 						    $FullFileName = $zip->statIndex($i);    
97 97
 					    
98
-						    if (!(substr($FullFileName['name'], -1, 1) ==="/"))
98
+						    if (!(substr($FullFileName['name'], -1, 1) === "/"))
99 99
 						    {
100 100
 								$fileinfo = pathinfo($OnlyFileName);
101
-								if(in_array(strtolower($fileinfo['extension']),$ext))
101
+								if (in_array(strtolower($fileinfo['extension']), $ext))
102 102
 								{
103
-								    copy('zip://'. $path .'#'. $OnlyFileName , $base_folder.$FullFileName['name'] ); 
103
+								    copy('zip://'.$path.'#'.$OnlyFileName, $base_folder.$FullFileName['name']); 
104 104
 								} 
105 105
 						    }
106 106
 						}
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 				    $phar = new PharData($path);
124 124
 				    $phar->decompressFiles();
125 125
 				    $files = array();
126
-				    check_files_extensions_on_phar( $phar, $files, '', $ext );
127
-				    $phar->extractTo( $current_path.fix_dirname( $_POST['path'] )."/", $files, TRUE );
126
+				    check_files_extensions_on_phar($phar, $files, '', $ext);
127
+				    $phar->extractTo($current_path.fix_dirname($_POST['path'])."/", $files, TRUE);
128 128
 
129 129
 				    break;
130 130
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 			    </div>
185 185
 			  </div>
186 186
 			<?php
187
-			if(in_array(strtolower($info['extension']), $ext_music)) {
187
+			if (in_array(strtolower($info['extension']), $ext_music)) {
188 188
 			?>
189 189
 
190 190
 				<script type="text/javascript">
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 				  </script>
211 211
 
212 212
 			<?php
213
-			} elseif(in_array(strtolower($info['extension']), $ext_video)) {
213
+			} elseif (in_array(strtolower($info['extension']), $ext_video)) {
214 214
 			?>
215 215
 			    
216 216
 			    <script type="text/javascript">
@@ -253,27 +253,27 @@  discard block
 block discarded – undo
253 253
 			if (is_dir($path))
254 254
 			{
255 255
 				// can't copy/cut dirs
256
-				if ($copy_cut_dirs === FALSE){
256
+				if ($copy_cut_dirs === FALSE) {
257 257
 					die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Folders));
258 258
 				}
259 259
 
260 260
 				// size over limit
261
-				if ($copy_cut_max_size !== FALSE && is_int($copy_cut_max_size)){
262
-					if (($copy_cut_max_size * 1024 * 1024) < foldersize($path)){
261
+				if ($copy_cut_max_size !== FALSE && is_int($copy_cut_max_size)) {
262
+					if (($copy_cut_max_size * 1024 * 1024) < foldersize($path)) {
263 263
 						die(sprintf(lang_Copy_Cut_Size_Limit, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_size));
264 264
 					}
265 265
 				}
266 266
 
267 267
 				// file count over limit
268
-				if ($copy_cut_max_count !== FALSE && is_int($copy_cut_max_count)){
269
-					if ($copy_cut_max_count < filescount($path)){
268
+				if ($copy_cut_max_count !== FALSE && is_int($copy_cut_max_count)) {
269
+					if ($copy_cut_max_count < filescount($path)) {
270 270
 						die(sprintf(lang_Copy_Cut_Count_Limit, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_count));
271 271
 					}
272 272
 				}
273 273
 			}
274 274
 			else {
275 275
 				// can't copy/cut files
276
-				if ($copy_cut_files === FALSE){
276
+				if ($copy_cut_files === FALSE) {
277 277
 					die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Files));
278 278
 				}
279 279
 			}
Please login to merge, or discard this patch.
Braces   +8 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,13 +1,14 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 include('config/config.php');
4
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('Access Denied!');
4
+if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") {
5
+    die('Access Denied!');
6
+}
5 7
 include('include/utils.php');
6 8
 
7 9
 if (isset($_SESSION['RF']['language_file']) && file_exists($_SESSION['RF']['language_file'])){
8 10
 	include($_SESSION['RF']['language_file']);
9
-}
10
-else {
11
+} else {
11 12
 	die('Language file is missing!');
12 13
 }
13 14
 
@@ -18,8 +19,7 @@  discard block
 block discarded – undo
18 19
 		case 'view':
19 20
 		    if(isset($_GET['type'])) {
20 21
 				$_SESSION['RF']["view_type"] = $_GET['type'];
21
-			}
22
-			else {
22
+			} else {
23 23
 				die('view type number missing');
24 24
 			}
25 25
 			break;
@@ -105,8 +105,7 @@  discard block
 block discarded – undo
105 105
 						    }
106 106
 						}
107 107
 						$zip->close();
108
-				    }
109
-				    else {
108
+				    } else {
110 109
 						die(lang_Zip_No_Extract);
111 110
 				    }
112 111
 
@@ -270,8 +269,7 @@  discard block
 block discarded – undo
270 269
 						die(sprintf(lang_Copy_Cut_Count_Limit, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), $copy_cut_max_count));
271 270
 					}
272 271
 				}
273
-			}
274
-			else {
272
+			} else {
275 273
 				// can't copy/cut files
276 274
 				if ($copy_cut_files === FALSE){
277 275
 					die(sprintf(lang_Copy_Cut_Not_Allowed, ($_POST['sub_action'] === 'copy' ? lcfirst(lang_Copy) : lcfirst(lang_Cut)), lang_Files));
@@ -288,8 +286,7 @@  discard block
 block discarded – undo
288 286
 			break;
289 287
 	    default: die('no action passed');
290 288
     }
291
-}
292
-else 
289
+} else 
293 290
 {
294 291
 	die('no action passed');
295 292
 }
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/external_plugins/filemanager/upload.php 3 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
     $i++;
27 27
     if($path==$current_path)  $cycle=false;
28 28
     if(file_exists($path."config.php")){
29
-	require_once($path."config.php");
30
-	$cycle=false;
29
+    require_once($path."config.php");
30
+    $cycle=false;
31 31
     }
32 32
     $path=fix_dirname($path).'/';
33 33
 }
@@ -36,83 +36,83 @@  discard block
 block discarded – undo
36 36
 if (!empty($_FILES)) {
37 37
     $info=pathinfo($_FILES['file']['name']);
38 38
     if(in_array(fix_strtolower($info['extension']), $ext)){
39
-	$tempFile = $_FILES['file']['tmp_name'];   
39
+    $tempFile = $_FILES['file']['tmp_name'];   
40 40
 	  
41
-	$targetPath = $storeFolder;
42
-	$targetPathThumb = $storeFolderThumb;
43
-	$_FILES['file']['name'] = fix_filename($_FILES['file']['name'],$transliteration);
41
+    $targetPath = $storeFolder;
42
+    $targetPathThumb = $storeFolderThumb;
43
+    $_FILES['file']['name'] = fix_filename($_FILES['file']['name'],$transliteration);
44 44
 	 
45
-	if(file_exists($targetPath.$_FILES['file']['name'])){
46
-	    $i = 1;
47
-	    $info=pathinfo($_FILES['file']['name']);
48
-	    while(file_exists($targetPath.$info['filename']."_".$i.".".$info['extension'])) {
49
-		    $i++;
50
-	    }
51
-	    $_FILES['file']['name']=$info['filename']."_".$i.".".$info['extension'];
52
-	}
53
-	$targetFile =  $targetPath. $_FILES['file']['name']; 
54
-	$targetFileThumb =  $targetPathThumb. $_FILES['file']['name'];
45
+    if(file_exists($targetPath.$_FILES['file']['name'])){
46
+        $i = 1;
47
+        $info=pathinfo($_FILES['file']['name']);
48
+        while(file_exists($targetPath.$info['filename']."_".$i.".".$info['extension'])) {
49
+            $i++;
50
+        }
51
+        $_FILES['file']['name']=$info['filename']."_".$i.".".$info['extension'];
52
+    }
53
+    $targetFile =  $targetPath. $_FILES['file']['name']; 
54
+    $targetFileThumb =  $targetPathThumb. $_FILES['file']['name'];
55 55
 	
56
-	if(in_array(fix_strtolower($info['extension']),$ext_img)) $is_img=true;
57
-	else $is_img=false;
56
+    if(in_array(fix_strtolower($info['extension']),$ext_img)) $is_img=true;
57
+    else $is_img=false;
58 58
 	
59 59
 	
60
-	move_uploaded_file($tempFile,$targetFile);
61
-	chmod($targetFile, 0755);
60
+    move_uploaded_file($tempFile,$targetFile);
61
+    chmod($targetFile, 0755);
62 62
 	
63
-	if($is_img){
64
-	    $memory_error=false;
65
-	    if(!create_img_gd($targetFile, $targetFileThumb, 122, 91)){
66
-		$memory_error=false;
67
-	    }else{
68
-		if(!new_thumbnails_creation($targetPath,$targetFile,$_FILES['file']['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height)){
69
-		    $memory_error=false;
70
-		}else{		    
71
-		    $imginfo =getimagesize($targetFile);
72
-		    $srcWidth = $imginfo[0];
73
-		    $srcHeight = $imginfo[1];
63
+    if($is_img){
64
+        $memory_error=false;
65
+        if(!create_img_gd($targetFile, $targetFileThumb, 122, 91)){
66
+        $memory_error=false;
67
+        }else{
68
+        if(!new_thumbnails_creation($targetPath,$targetFile,$_FILES['file']['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height)){
69
+            $memory_error=false;
70
+        }else{		    
71
+            $imginfo =getimagesize($targetFile);
72
+            $srcWidth = $imginfo[0];
73
+            $srcHeight = $imginfo[1];
74 74
 		    
75
-		    if($image_resizing){
76
-			if($image_resizing_width==0){
77
-			    if($image_resizing_height==0){
78
-				$image_resizing_width=$srcWidth;
79
-				$image_resizing_height =$srcHeight;
80
-			    }else{
81
-				$image_resizing_width=$image_resizing_height*$srcWidth/$srcHeight;
82
-			}
83
-			}elseif($image_resizing_height==0){
84
-			    $image_resizing_height =$image_resizing_width*$srcHeight/$srcWidth;
85
-			}
86
-			$srcWidth=$image_resizing_width;
87
-			$srcHeight=$image_resizing_height;
88
-			create_img_gd($targetFile, $targetFile, $image_resizing_width, $image_resizing_height);
89
-		    }
90
-		    //max resizing limit control
91
-		    $resize=false;
92
-		    if($image_max_width!=0 && $srcWidth >$image_max_width){
93
-			$resize=true;
94
-			$srcHeight=$image_max_width*$srcHeight/$srcWidth;
95
-			$srcWidth=$image_max_width;
96
-		    }
97
-		    if($image_max_height!=0 && $srcHeight >$image_max_height){
98
-			$resize=true;
99
-			$srcWidth =$image_max_height*$srcWidth/$srcHeight;
100
-			$srcHeight =$image_max_height;
101
-		    }
102
-		    if($resize)
103
-			create_img_gd($targetFile, $targetFile, $srcWidth, $srcHeight);
104
-		}
105
-	    }		
106
-	    if($memory_error){
107
-		//error
108
-		unlink($targetFile);
109
-		header('HTTP/1.1 406 Not enought Memory',true,406);
110
-		exit();
111
-	    }
112
-	}
75
+            if($image_resizing){
76
+            if($image_resizing_width==0){
77
+                if($image_resizing_height==0){
78
+                $image_resizing_width=$srcWidth;
79
+                $image_resizing_height =$srcHeight;
80
+                }else{
81
+                $image_resizing_width=$image_resizing_height*$srcWidth/$srcHeight;
82
+            }
83
+            }elseif($image_resizing_height==0){
84
+                $image_resizing_height =$image_resizing_width*$srcHeight/$srcWidth;
85
+            }
86
+            $srcWidth=$image_resizing_width;
87
+            $srcHeight=$image_resizing_height;
88
+            create_img_gd($targetFile, $targetFile, $image_resizing_width, $image_resizing_height);
89
+            }
90
+            //max resizing limit control
91
+            $resize=false;
92
+            if($image_max_width!=0 && $srcWidth >$image_max_width){
93
+            $resize=true;
94
+            $srcHeight=$image_max_width*$srcHeight/$srcWidth;
95
+            $srcWidth=$image_max_width;
96
+            }
97
+            if($image_max_height!=0 && $srcHeight >$image_max_height){
98
+            $resize=true;
99
+            $srcWidth =$image_max_height*$srcWidth/$srcHeight;
100
+            $srcHeight =$image_max_height;
101
+            }
102
+            if($resize)
103
+            create_img_gd($targetFile, $targetFile, $srcWidth, $srcHeight);
104
+        }
105
+        }		
106
+        if($memory_error){
107
+        //error
108
+        unlink($targetFile);
109
+        header('HTTP/1.1 406 Not enought Memory',true,406);
110
+        exit();
111
+        }
112
+    }
113 113
     }else{
114
-	header('HTTP/1.1 406 file not permitted',true,406);
115
-	exit();
114
+    header('HTTP/1.1 406 file not permitted',true,406);
115
+    exit();
116 116
     }
117 117
 }else{
118 118
     header('HTTP/1.1 405 Bad Request', true, 405);
Please login to merge, or discard this patch.
Spacing   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,124 +1,124 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 include('config/config.php');
3
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden');
3
+if ($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden');
4 4
 include('include/utils.php');
5 5
 
6 6
 
7 7
 $storeFolder = $_POST['path'];
8 8
 $storeFolderThumb = $_POST['path_thumb'];
9 9
 
10
-$path_pos=strpos($storeFolder,$current_path);
11
-$thumb_pos=strpos($_POST['path_thumb'],$thumbs_base_path);
12
-if($path_pos!==0 
13
-    || $thumb_pos !==0
14
-    || strpos($storeFolderThumb,'../',strlen($thumbs_base_path))!==FALSE
15
-    || strpos($storeFolderThumb,'./',strlen($thumbs_base_path))!==FALSE
16
-    || strpos($storeFolder,'../',strlen($current_path))!==FALSE
17
-    || strpos($storeFolder,'./',strlen($current_path))!==FALSE )
10
+$path_pos = strpos($storeFolder, $current_path);
11
+$thumb_pos = strpos($_POST['path_thumb'], $thumbs_base_path);
12
+if ($path_pos !== 0 
13
+    || $thumb_pos !== 0
14
+    || strpos($storeFolderThumb, '../', strlen($thumbs_base_path)) !== FALSE
15
+    || strpos($storeFolderThumb, './', strlen($thumbs_base_path)) !== FALSE
16
+    || strpos($storeFolder, '../', strlen($current_path)) !== FALSE
17
+    || strpos($storeFolder, './', strlen($current_path)) !== FALSE)
18 18
     die('wrong path');
19 19
 
20 20
 
21
-$path=$storeFolder;
22
-$cycle=true;
23
-$max_cycles=50;
24
-$i=0;
25
-while($cycle && $i<$max_cycles){
21
+$path = $storeFolder;
22
+$cycle = true;
23
+$max_cycles = 50;
24
+$i = 0;
25
+while ($cycle && $i < $max_cycles) {
26 26
     $i++;
27
-    if($path==$current_path)  $cycle=false;
28
-    if(file_exists($path."config.php")){
27
+    if ($path == $current_path)  $cycle = false;
28
+    if (file_exists($path."config.php")) {
29 29
 	require_once($path."config.php");
30
-	$cycle=false;
30
+	$cycle = false;
31 31
     }
32
-    $path=fix_dirname($path).'/';
32
+    $path = fix_dirname($path).'/';
33 33
 }
34 34
 
35 35
 
36 36
 if (!empty($_FILES)) {
37
-    $info=pathinfo($_FILES['file']['name']);
38
-    if(in_array(fix_strtolower($info['extension']), $ext)){
37
+    $info = pathinfo($_FILES['file']['name']);
38
+    if (in_array(fix_strtolower($info['extension']), $ext)) {
39 39
 	$tempFile = $_FILES['file']['tmp_name'];   
40 40
 	  
41 41
 	$targetPath = $storeFolder;
42 42
 	$targetPathThumb = $storeFolderThumb;
43
-	$_FILES['file']['name'] = fix_filename($_FILES['file']['name'],$transliteration);
43
+	$_FILES['file']['name'] = fix_filename($_FILES['file']['name'], $transliteration);
44 44
 	 
45
-	if(file_exists($targetPath.$_FILES['file']['name'])){
45
+	if (file_exists($targetPath.$_FILES['file']['name'])) {
46 46
 	    $i = 1;
47
-	    $info=pathinfo($_FILES['file']['name']);
48
-	    while(file_exists($targetPath.$info['filename']."_".$i.".".$info['extension'])) {
47
+	    $info = pathinfo($_FILES['file']['name']);
48
+	    while (file_exists($targetPath.$info['filename']."_".$i.".".$info['extension'])) {
49 49
 		    $i++;
50 50
 	    }
51
-	    $_FILES['file']['name']=$info['filename']."_".$i.".".$info['extension'];
51
+	    $_FILES['file']['name'] = $info['filename']."_".$i.".".$info['extension'];
52 52
 	}
53
-	$targetFile =  $targetPath. $_FILES['file']['name']; 
54
-	$targetFileThumb =  $targetPathThumb. $_FILES['file']['name'];
53
+	$targetFile = $targetPath.$_FILES['file']['name']; 
54
+	$targetFileThumb = $targetPathThumb.$_FILES['file']['name'];
55 55
 	
56
-	if(in_array(fix_strtolower($info['extension']),$ext_img)) $is_img=true;
57
-	else $is_img=false;
56
+	if (in_array(fix_strtolower($info['extension']), $ext_img)) $is_img = true;
57
+	else $is_img = false;
58 58
 	
59 59
 	
60
-	move_uploaded_file($tempFile,$targetFile);
60
+	move_uploaded_file($tempFile, $targetFile);
61 61
 	chmod($targetFile, 0755);
62 62
 	
63
-	if($is_img){
64
-	    $memory_error=false;
65
-	    if(!create_img_gd($targetFile, $targetFileThumb, 122, 91)){
66
-		$memory_error=false;
67
-	    }else{
68
-		if(!new_thumbnails_creation($targetPath,$targetFile,$_FILES['file']['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height)){
69
-		    $memory_error=false;
70
-		}else{		    
71
-		    $imginfo =getimagesize($targetFile);
63
+	if ($is_img) {
64
+	    $memory_error = false;
65
+	    if (!create_img_gd($targetFile, $targetFileThumb, 122, 91)) {
66
+		$memory_error = false;
67
+	    } else {
68
+		if (!new_thumbnails_creation($targetPath, $targetFile, $_FILES['file']['name'], $current_path, $relative_image_creation, $relative_path_from_current_pos, $relative_image_creation_name_to_prepend, $relative_image_creation_name_to_append, $relative_image_creation_width, $relative_image_creation_height, $fixed_image_creation, $fixed_path_from_filemanager, $fixed_image_creation_name_to_prepend, $fixed_image_creation_to_append, $fixed_image_creation_width, $fixed_image_creation_height)) {
69
+		    $memory_error = false;
70
+		} else {		    
71
+		    $imginfo = getimagesize($targetFile);
72 72
 		    $srcWidth = $imginfo[0];
73 73
 		    $srcHeight = $imginfo[1];
74 74
 		    
75
-		    if($image_resizing){
76
-			if($image_resizing_width==0){
77
-			    if($image_resizing_height==0){
78
-				$image_resizing_width=$srcWidth;
79
-				$image_resizing_height =$srcHeight;
80
-			    }else{
81
-				$image_resizing_width=$image_resizing_height*$srcWidth/$srcHeight;
75
+		    if ($image_resizing) {
76
+			if ($image_resizing_width == 0) {
77
+			    if ($image_resizing_height == 0) {
78
+				$image_resizing_width = $srcWidth;
79
+				$image_resizing_height = $srcHeight;
80
+			    } else {
81
+				$image_resizing_width = $image_resizing_height * $srcWidth / $srcHeight;
82 82
 			}
83
-			}elseif($image_resizing_height==0){
84
-			    $image_resizing_height =$image_resizing_width*$srcHeight/$srcWidth;
83
+			}elseif ($image_resizing_height == 0) {
84
+			    $image_resizing_height = $image_resizing_width * $srcHeight / $srcWidth;
85 85
 			}
86
-			$srcWidth=$image_resizing_width;
87
-			$srcHeight=$image_resizing_height;
86
+			$srcWidth = $image_resizing_width;
87
+			$srcHeight = $image_resizing_height;
88 88
 			create_img_gd($targetFile, $targetFile, $image_resizing_width, $image_resizing_height);
89 89
 		    }
90 90
 		    //max resizing limit control
91
-		    $resize=false;
92
-		    if($image_max_width!=0 && $srcWidth >$image_max_width){
93
-			$resize=true;
94
-			$srcHeight=$image_max_width*$srcHeight/$srcWidth;
95
-			$srcWidth=$image_max_width;
91
+		    $resize = false;
92
+		    if ($image_max_width != 0 && $srcWidth > $image_max_width) {
93
+			$resize = true;
94
+			$srcHeight = $image_max_width * $srcHeight / $srcWidth;
95
+			$srcWidth = $image_max_width;
96 96
 		    }
97
-		    if($image_max_height!=0 && $srcHeight >$image_max_height){
98
-			$resize=true;
99
-			$srcWidth =$image_max_height*$srcWidth/$srcHeight;
100
-			$srcHeight =$image_max_height;
97
+		    if ($image_max_height != 0 && $srcHeight > $image_max_height) {
98
+			$resize = true;
99
+			$srcWidth = $image_max_height * $srcWidth / $srcHeight;
100
+			$srcHeight = $image_max_height;
101 101
 		    }
102
-		    if($resize)
102
+		    if ($resize)
103 103
 			create_img_gd($targetFile, $targetFile, $srcWidth, $srcHeight);
104 104
 		}
105 105
 	    }		
106
-	    if($memory_error){
106
+	    if ($memory_error) {
107 107
 		//error
108 108
 		unlink($targetFile);
109
-		header('HTTP/1.1 406 Not enought Memory',true,406);
109
+		header('HTTP/1.1 406 Not enought Memory', true, 406);
110 110
 		exit();
111 111
 	    }
112 112
 	}
113
-    }else{
114
-	header('HTTP/1.1 406 file not permitted',true,406);
113
+    } else {
114
+	header('HTTP/1.1 406 file not permitted', true, 406);
115 115
 	exit();
116 116
     }
117
-}else{
117
+} else {
118 118
     header('HTTP/1.1 405 Bad Request', true, 405);
119 119
     exit();
120 120
 }
121
-if(isset($_POST['submit'])){
121
+if (isset($_POST['submit'])) {
122 122
     $query = http_build_query(array(
123 123
         'type'      => $_POST['type'],
124 124
         'lang'      => $_POST['lang'],
@@ -126,5 +126,5 @@  discard block
 block discarded – undo
126 126
         'field_id'  => $_POST['field_id'],
127 127
         'fldr'      => $_POST['fldr'],
128 128
     ));
129
-    header("location: dialog.php?" . $query);
129
+    header("location: dialog.php?".$query);
130 130
 }
Please login to merge, or discard this patch.
Braces   +22 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 include('config/config.php');
3
-if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") die('forbiden');
3
+if($_SESSION['RF']["verify"] !== "RESPONSIVEfilemanager") {
4
+    die('forbiden');
5
+}
4 6
 include('include/utils.php');
5 7
 
6 8
 
@@ -14,8 +16,9 @@  discard block
 block discarded – undo
14 16
     || strpos($storeFolderThumb,'../',strlen($thumbs_base_path))!==FALSE
15 17
     || strpos($storeFolderThumb,'./',strlen($thumbs_base_path))!==FALSE
16 18
     || strpos($storeFolder,'../',strlen($current_path))!==FALSE
17
-    || strpos($storeFolder,'./',strlen($current_path))!==FALSE )
19
+    || strpos($storeFolder,'./',strlen($current_path))!==FALSE ) {
18 20
     die('wrong path');
21
+}
19 22
 
20 23
 
21 24
 $path=$storeFolder;
@@ -24,7 +27,9 @@  discard block
 block discarded – undo
24 27
 $i=0;
25 28
 while($cycle && $i<$max_cycles){
26 29
     $i++;
27
-    if($path==$current_path)  $cycle=false;
30
+    if($path==$current_path) {
31
+        $cycle=false;
32
+    }
28 33
     if(file_exists($path."config.php")){
29 34
 	require_once($path."config.php");
30 35
 	$cycle=false;
@@ -53,8 +58,11 @@  discard block
 block discarded – undo
53 58
 	$targetFile =  $targetPath. $_FILES['file']['name']; 
54 59
 	$targetFileThumb =  $targetPathThumb. $_FILES['file']['name'];
55 60
 	
56
-	if(in_array(fix_strtolower($info['extension']),$ext_img)) $is_img=true;
57
-	else $is_img=false;
61
+	if(in_array(fix_strtolower($info['extension']),$ext_img)) {
62
+	    $is_img=true;
63
+	} else {
64
+	    $is_img=false;
65
+	}
58 66
 	
59 67
 	
60 68
 	move_uploaded_file($tempFile,$targetFile);
@@ -64,10 +72,10 @@  discard block
 block discarded – undo
64 72
 	    $memory_error=false;
65 73
 	    if(!create_img_gd($targetFile, $targetFileThumb, 122, 91)){
66 74
 		$memory_error=false;
67
-	    }else{
75
+	    } else{
68 76
 		if(!new_thumbnails_creation($targetPath,$targetFile,$_FILES['file']['name'],$current_path,$relative_image_creation,$relative_path_from_current_pos,$relative_image_creation_name_to_prepend,$relative_image_creation_name_to_append,$relative_image_creation_width,$relative_image_creation_height,$fixed_image_creation,$fixed_path_from_filemanager,$fixed_image_creation_name_to_prepend,$fixed_image_creation_to_append,$fixed_image_creation_width,$fixed_image_creation_height)){
69 77
 		    $memory_error=false;
70
-		}else{		    
78
+		} else{		    
71 79
 		    $imginfo =getimagesize($targetFile);
72 80
 		    $srcWidth = $imginfo[0];
73 81
 		    $srcHeight = $imginfo[1];
@@ -77,10 +85,10 @@  discard block
 block discarded – undo
77 85
 			    if($image_resizing_height==0){
78 86
 				$image_resizing_width=$srcWidth;
79 87
 				$image_resizing_height =$srcHeight;
80
-			    }else{
88
+			    } else{
81 89
 				$image_resizing_width=$image_resizing_height*$srcWidth/$srcHeight;
82 90
 			}
83
-			}elseif($image_resizing_height==0){
91
+			} elseif($image_resizing_height==0){
84 92
 			    $image_resizing_height =$image_resizing_width*$srcHeight/$srcWidth;
85 93
 			}
86 94
 			$srcWidth=$image_resizing_width;
@@ -99,8 +107,9 @@  discard block
 block discarded – undo
99 107
 			$srcWidth =$image_max_height*$srcWidth/$srcHeight;
100 108
 			$srcHeight =$image_max_height;
101 109
 		    }
102
-		    if($resize)
103
-			create_img_gd($targetFile, $targetFile, $srcWidth, $srcHeight);
110
+		    if($resize) {
111
+		    			create_img_gd($targetFile, $targetFile, $srcWidth, $srcHeight);
112
+		    }
104 113
 		}
105 114
 	    }		
106 115
 	    if($memory_error){
@@ -110,11 +119,11 @@  discard block
 block discarded – undo
110 119
 		exit();
111 120
 	    }
112 121
 	}
113
-    }else{
122
+    } else{
114 123
 	header('HTTP/1.1 406 file not permitted',true,406);
115 124
 	exit();
116 125
     }
117
-}else{
126
+} else{
118 127
     header('HTTP/1.1 405 Bad Request', true, 405);
119 128
     exit();
120 129
 }
Please login to merge, or discard this patch.