Skip to content

Commit f2355a6

Browse files
committed
Fixed missing value from config
1 parent 524ec24 commit f2355a6

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
# Composer
4242
/composer.phar
4343

44+
/vendor
4445
!/vendor/index.html
4546

4647
# IDE Helper
@@ -54,6 +55,7 @@ npm-debug.log
5455

5556
#docker
5657
/docker/nginx/logs/*
58+
/.env
5759

5860
# System
5961
ftpsync.settings

manager/actions/files.dynamic.php

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
33
die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
44
}
5-
if (!EvolutionCMS()->hasPermission('file_manager')) {
6-
EvolutionCMS()->webAlertAndQuit($_lang["error_no_privileges"]);
5+
if (!evo()->hasPermission('file_manager')) {
6+
evo()->webAlertAndQuit($_lang["error_no_privileges"]);
77
}
88
$token_check = checkToken();
99
$newToken = makeToken();
1010

1111
// settings
12-
$theme_image_path = MODX_MANAGER_URL . 'media/style/' . EvolutionCMS()->getConfig('manager_theme') . '/images/';
12+
$theme_image_path = MODX_MANAGER_URL . 'media/style/' . evo()->getConfig('manager_theme') . '/images/';
1313
$excludes = array(
1414
'.',
1515
'..',
@@ -35,26 +35,26 @@
3535
$protected_path[] = MODX_BASE_PATH . 'temp/backup';
3636
$protected_path[] = MODX_BASE_PATH . 'assets/backup';
3737

38-
if (!EvolutionCMS()->hasPermission('save_plugin')) {
38+
if (!evo()->hasPermission('save_plugin')) {
3939
$protected_path[] = MODX_BASE_PATH . 'assets/plugins';
4040
}
41-
if (!EvolutionCMS()->hasPermission('save_snippet')) {
41+
if (!evo()->hasPermission('save_snippet')) {
4242
$protected_path[] = MODX_BASE_PATH . 'assets/snippets';
4343
}
44-
if (!EvolutionCMS()->hasPermission('save_template')) {
44+
if (!evo()->hasPermission('save_template')) {
4545
$protected_path[] = MODX_BASE_PATH . 'assets/templates';
4646
}
47-
if (!EvolutionCMS()->hasPermission('save_module')) {
47+
if (!evo()->hasPermission('save_module')) {
4848
$protected_path[] = MODX_BASE_PATH . 'assets/modules';
4949
}
50-
if (!EvolutionCMS()->hasPermission('empty_cache')) {
50+
if (!evo()->hasPermission('empty_cache')) {
5151
$protected_path[] = MODX_BASE_PATH . 'assets/cache';
5252
}
53-
if (!EvolutionCMS()->hasPermission('import_static')) {
53+
if (!evo()->hasPermission('import_static')) {
5454
$protected_path[] = MODX_BASE_PATH . 'temp/import';
5555
$protected_path[] = MODX_BASE_PATH . 'assets/import';
5656
}
57-
if (!EvolutionCMS()->hasPermission('export_static')) {
57+
if (!evo()->hasPermission('export_static')) {
5858
$protected_path[] = MODX_BASE_PATH . 'temp/export';
5959
$protected_path[] = MODX_BASE_PATH . 'assets/export';
6060
}
@@ -65,17 +65,18 @@
6565
// Mod added by Raymond
6666
$enablefileunzip = true;
6767
$enablefiledownload = true;
68-
$newfolderaccessmode = octdec(evolutionCMS()->getConfig('new_folder_permissions', '0777'));
69-
$new_file_permissions = octdec(evolutionCMS()->getConfig('new_file_permissions', '0666'));
68+
$newfolderaccessmode = octdec(evo()->getConfig('new_folder_permissions', '0777'));
69+
$new_file_permissions = octdec(evo()->getConfig('new_file_permissions', '0666'));
7070
// End Mod - by Raymond
7171
// make arrays from the file upload settings
72-
$upload_files = explode(',', evolutionCMS()->getConfig('upload_files', ''));
73-
$upload_images = explode(',', evolutionCMS()->getConfig('upload_images', ''));
74-
$upload_media = explode(',', evolutionCMS()->getConfig('upload_media', ''));
72+
$upload_files = explode(',', evo()->getConfig('upload_files', ''));
73+
$upload_images = explode(',', evo()->getConfig('upload_images', ''));
74+
$upload_media = explode(',', evo()->getConfig('upload_media', ''));
7575
// now merge them
7676
$uploadablefiles = array_merge($upload_files, $upload_images, $upload_media);
7777
$uploadablefiles = add_dot($uploadablefiles);
78-
$filemanager_path = evolutionCMS()->getConfig('filemanager_path', MODX_BASE_PATH);
78+
$upload_maxsize = evo()->getConfig('upload_maxsize');
79+
$filemanager_path = evo()->getConfig('filemanager_path', MODX_BASE_PATH);
7980

8081
// end settings
8182

@@ -89,7 +90,7 @@
8990
$startpath = rtrim($startpath, '/');
9091

9192
if (!is_readable($startpath)) {
92-
EvolutionCMS()->webAlertAndQuit($_lang["not_readable_dir"]);
93+
evo()->webAlertAndQuit($_lang["not_readable_dir"]);
9394
}
9495

9596
// Raymond: get web start path for showing pictures
@@ -240,7 +241,7 @@ function renameFile(file) {
240241
}
241242

242243
if (in_array($startpath, $protected_path)) {
243-
EvolutionCMS()->webAlertAndQuit($_lang["files.dynamic.php2"]);
244+
evo()->webAlertAndQuit($_lang["files.dynamic.php2"]);
244245
}
245246

246247
$tpl = '<i class="[+image+] FilesTopFolder"></i>[+subject+]';
@@ -285,7 +286,7 @@ function renameFile(file) {
285286
</div>
286287
<?php // check to see user isn't trying to move below the document_root
287288
if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) {
288-
EvolutionCMS()->webAlertAndQuit($_lang["files_access_denied"]);
289+
evo()->webAlertAndQuit($_lang["files_access_denied"]);
289290
}
290291

291292
// Unzip .zip files - by Raymond
@@ -445,7 +446,7 @@ function renameFile(file) {
445446
?>
446447

447448
<form name="upload" enctype="multipart/form-data" action="index.php" method="post">
448-
<input type="hidden" name="MAX_FILE_SIZE" value="<?= isset($upload_maxsize) ? $upload_maxsize : 3145728 ?>">
449+
<input type="hidden" name="MAX_FILE_SIZE" value="<?= $upload_maxsize ?? 5000000 ?>">
449450
<input type="hidden" name="a" value="31">
450451
<input type="hidden" name="path" value="<?= $startpath ?>">
451452

@@ -480,7 +481,7 @@ function renameFile(file) {
480481
// Log the change
481482
logFileChange('view', $filename);
482483
if ($buffer === false) {
483-
EvolutionCMS()->webAlertAndQuit("Error opening file for reading.");
484+
evo()->webAlertAndQuit("Error opening file for reading.");
484485
}
485486
?>
486487
<form action="index.php" method="post" name="editFile">
@@ -514,7 +515,7 @@ function renameFile(file) {
514515
default:
515516
$contentType = 'htmlmixed';
516517
};
517-
$evtOut = EvolutionCMS()->invokeEvent('OnRichTextEditorInit', array(
518+
$evtOut = evo()->invokeEvent('OnRichTextEditorInit', array(
518519
'editor' => 'Codemirror',
519520
'elements' => array(
520521
'content',

0 commit comments

Comments
 (0)