TYPO ERRORS

Post Reply
gathlete
Posts: 8
Joined: Sat Jan 06, 2024 8:15 am
Been thanked: 1 time

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
);
}
}
User avatar
bonya
Posts: 9
Joined: Fri Mar 19, 2021 2:01 am

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
as well as in the file web\add\user\index.php... also present in HestiaCP
Rename the deleteItem method to deleteDirectory.
file deletion doesn't work after that
Post Reply