diff options
author | Tom Needham <needham.thomas@gmail.com> | 2012-04-03 22:31:34 +0000 |
---|---|---|
committer | Tom Needham <needham.thomas@gmail.com> | 2012-04-03 22:31:34 +0000 |
commit | acdce2b1e01f7c0a77b7e7949540e1b0ba94efd1 (patch) | |
tree | 8955df1e7890cc2f51b24251cb293bcf76b016fd /lib/filesystem.php | |
parent | 95c2ac5d585bfd1106b173c00b4c29719c08b25f (diff) | |
download | nextcloud-server-acdce2b1e01f7c0a77b7e7949540e1b0ba94efd1.tar.gz nextcloud-server-acdce2b1e01f7c0a77b7e7949540e1b0ba94efd1.zip |
Check blacklist before saving to filesystem
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r-- | lib/filesystem.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php index 12905d189f9..b6909f5acdf 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -298,6 +298,19 @@ class OC_Filesystem{ } return true; } + + /** + * checks if a file is blacklsited for storage in the filesystem + * @param array $data from hook + */ + static public function isBlacklisted($data){ + $blacklist = array('.htaccess'); + $filename = strtolower(basename($data['path'])); + if(in_array($filename,$blacklist)){ + $data['run'] = false; + } + } + /** * following functions are equivilent to their php buildin equivilents for arguments/return values. */ |