aboutsummaryrefslogtreecommitdiffstats
path: root/include/plugin.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-18 14:55:19 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-18 14:55:19 -0800
commited5ca9e4ccb2741c33ac2c88082728066bc715fb (patch)
tree7bc03907da16c69d8beeae09c8d6408d856a19aa /include/plugin.php
parent8d61efa0e865203df5eb4fae90b7bbd48597cf03 (diff)
downloadvolse-hubzilla-ed5ca9e4ccb2741c33ac2c88082728066bc715fb.tar.gz
volse-hubzilla-ed5ca9e4ccb2741c33ac2c88082728066bc715fb.tar.bz2
volse-hubzilla-ed5ca9e4ccb2741c33ac2c88082728066bc715fb.zip
use realpath to bypass symlinks and check actually directory
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-xinclude/plugin.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 1f4d60736..4a35a0170 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -636,3 +636,13 @@ function get_std_version() {
return STD_VERSION;
return '0.0.0';
}
+
+
+function folder_exists($folder)
+{
+ // Get canonicalized absolute pathname
+ $path = realpath($folder);
+
+ // If it exist, check if it's a directory
+ return (($path !== false) && is_dir($path)) ? $path : false;
+} \ No newline at end of file