summaryrefslogtreecommitdiff
path: root/modules/server_add/helpers/server_add.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-08-27 16:11:47 -0700
committerBharat Mediratta <bharat@menalto.com>2009-08-27 16:11:47 -0700
commit74363ced870d4114e7570729636875e0258917b3 (patch)
tree61bc27831a362994fc96ea90172d50e25d5c76cb /modules/server_add/helpers/server_add.php
parent98e9a96ba4d2419e02717369be8c0d886bc35ef7 (diff)
parent4828db003f3ee505eb9e6d056cdb142da34b78ff (diff)
Merge branch 'master' of git@github.com:gallery/gallery3 into HEAD
Conflicts: modules/slideshow/helpers/slideshow_event.php
Diffstat (limited to 'modules/server_add/helpers/server_add.php')
-rw-r--r--modules/server_add/helpers/server_add.php15
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;
+ }
}