Skip to content

Commit

Permalink
fix: Correct closing bracket for if statement in detect_and_move_plug…
Browse files Browse the repository at this point in the history
…in function
  • Loading branch information
erseco committed Oct 19, 2024
1 parent 8c9abba commit ac0fa2e
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions rootfs/var/www/html/admin/cli/install_plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,17 @@ function detect_and_move_plugin($pluginname, $sourcepath, $type) {
if (array_key_exists($type, $plugin_types)) {
$destination = $plugin_types[$type] . basename($sourcepath);

// Ensure the directory is writable before moving the plugin
if (!is_writable($path)) {
cli_error("Directory $path is not writable. Check permissions.");
}

// Move the plugin to the correct directory
if (rename($sourcepath, $destination)) {
cli_writeln("Plugin moved to $destination.");
return $destination;
} else {
return false;
}
// Ensure the directory is writable before moving the plugin
if (!is_writable($destination)) {
cli_error("Directory $destination is not writable. Check permissions.");
}

// Move the plugin to the correct directory
if (rename($sourcepath, $destination)) {
cli_writeln("Plugin moved to $destination.");
return $destination;
} else {
return false;
}
}

Expand Down

0 comments on commit ac0fa2e

Please sign in to comment.