diff options
Diffstat (limited to 'lib/helper.php')
-rwxr-xr-x | lib/helper.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php index 412f0e6b764..52278f5c3a2 100755 --- a/lib/helper.php +++ b/lib/helper.php @@ -520,4 +520,15 @@ class OC_Helper { return $newname; } + + /* + * checks if $sub is a subdirectory of $parent + * + * @param $sub + * @param $parent + * @return bool + */ + public static function issubdirectory($sub, $parent){ + return (substr(realpath($sub), 0, strlen(realpath($parent))) == realpath($parent))?true:false; + } } |