I hope im on the right track...
1. vesta/web/edit/package/index.php
has an typo line 110 if (empty($_POST['v_shell'])) $errrors[] = __('shell');
need to change errrors to errors
2. vesta/web/file_manager/fm_core.php
The code seems to have a bug in the delete Item method. When this method is called, it tries to delete a directory using the v-delete-fs-directory command, but the command being executed is v-delete-fs-directory instead of v-delete-fs-file. This results in an error and the directory is not deleted.
The cause of the bug is a typo in the method name. The method should be named deleteDirectory instead of deleteItem. Additionally, the command being executed should be v-delete-fs-directory instead of v-delete-fs-file.
Solution
To fix the bug, we need to make the following changes:
Rename the deleteItem method to deleteDirectory.
Change the command being executed in the deleteDirectory method to v-delete-fs-directory.
Here's the updated code:
language-php
function deleteDirectory($dir, $item) {
$dir = $this->formatFullPath($item);
exec (VESTA_CMD . "v-delete-fs-directory {$this->user} {$dir}", $output, $return_var);
$error = self::check_return_code($return_var, $output);
if (empty($error)) {
return array(
'result' => true
);
}
else {
return array(
'result' => false,
'message' => $error
);
}
}
1. vesta/web/edit/package/index.php
has an typo line 110 if (empty($_POST['v_shell'])) $errrors[] = __('shell');
need to change errrors to errors
2. vesta/web/file_manager/fm_core.php
The code seems to have a bug in the delete Item method. When this method is called, it tries to delete a directory using the v-delete-fs-directory command, but the command being executed is v-delete-fs-directory instead of v-delete-fs-file. This results in an error and the directory is not deleted.
The cause of the bug is a typo in the method name. The method should be named deleteDirectory instead of deleteItem. Additionally, the command being executed should be v-delete-fs-directory instead of v-delete-fs-file.
Solution
To fix the bug, we need to make the following changes:
Rename the deleteItem method to deleteDirectory.
Change the command being executed in the deleteDirectory method to v-delete-fs-directory.
Here's the updated code:
language-php
function deleteDirectory($dir, $item) {
$dir = $this->formatFullPath($item);
exec (VESTA_CMD . "v-delete-fs-directory {$this->user} {$dir}", $output, $return_var);
$error = self::check_return_code($return_var, $output);
if (empty($error)) {
return array(
'result' => true
);
}
else {
return array(
'result' => false,
'message' => $error
);
}
}
Statistics: Posted by gathlete — Tue Jan 16, 2024 12:50 pm