fix security vuln #225

This commit is contained in:
daniel 2024-12-09 16:00:56 +01:00
parent 8761a28268
commit 3768061e71

View File

@ -217,11 +217,14 @@ if ($filemanager) {
if ($edit_file) {
$location_file = io_safe_output(get_parameter('location_file', ''));
$filename = array_pop(explode('/', $location_file));
if (empty($location_file) === false
&& strpos($location_file, realpath('attachment/plugin')) !== false
&& file_exists($location_file) === true
) {
$file = file_get_contents($location_file);
echo '<h4>'.__('Edit file').' '.$filename.'</h4>';
// echo "<a href='index.php?sec=gagente&sec2=enterprise/godmode/agentes/collections&action=file&id=" . $collection['id'] . "&directory=" . $relative_dir . "&hash2=" . $hash2 . "'>" . __('Back to file explorer') . "</a>";
echo "<form method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1"."&update_file=1'>";
// html_print_input_hidden('location_file', $locationFile);
echo "<form method='post' action='index.php?sec=gservers&sec2=godmode/servers/plugin&filemanager=1&update_file=1'>";
echo "<table class='w98p'>";
echo '<tr>';
echo '<th>'.__('Edit').'</th>';
@ -248,6 +251,9 @@ if ($filemanager) {
echo '</tr>';
echo '</table>';
echo '</form>';
} else {
echo __('File not found');
}
} else {
if ($update_file) {
$location_file = io_safe_output(get_parameter('location_file', ''));