diff options
Diffstat (limited to 'modules/server_add/helpers/server_add.php')
-rw-r--r-- | modules/server_add/helpers/server_add.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/server_add/helpers/server_add.php b/modules/server_add/helpers/server_add.php index f75a09d2..74f51ad9 100644 --- a/modules/server_add/helpers/server_add.php +++ b/modules/server_add/helpers/server_add.php @@ -31,4 +31,19 @@ class server_add_Core { site_status::clear("server_add_configuration"); } } + + static function is_valid_path($path) { + if (!is_readable($path) || is_link($path)) { + return false; + } + + $authorized_paths = unserialize(module::get_var("server_add", "authorized_paths")); + foreach (array_keys($authorized_paths) as $valid_path) { + if (strpos($path, $valid_path) === 0) { + return true; + } + } + + return false; + } } |