diff --git a/pandora_console/godmode/servers/plugin.php b/pandora_console/godmode/servers/plugin.php
index 79d0f11870..3cf7de1803 100644
--- a/pandora_console/godmode/servers/plugin.php
+++ b/pandora_console/godmode/servers/plugin.php
@@ -217,37 +217,43 @@ if ($filemanager) {
if ($edit_file) {
$location_file = io_safe_output(get_parameter('location_file', ''));
$filename = array_pop(explode('/', $location_file));
- $file = file_get_contents($location_file);
- echo '
'.__('Edit file').' '.$filename.'
';
- // echo "" . __('Back to file explorer') . "";
- echo "';
+ if (empty($location_file) === false
+ && strpos($location_file, realpath('attachment/plugin')) !== false
+ && file_exists($location_file) === true
+ ) {
+ $file = file_get_contents($location_file);
+ echo ''.__('Edit file').' '.$filename.'
';
+ echo "';
+ } else {
+ echo __('File not found');
+ }
} else {
if ($update_file) {
$location_file = io_safe_output(get_parameter('location_file', ''));