diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-11 11:04:04 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-08-11 11:04:04 -0400 |
commit | 465767670bef61572bb38cabce901935d9e23e7b (patch) | |
tree | df980c067b26d3b3daa38fe2e7c968d8df899490 /lib/filesystem.php | |
parent | 39b9052c2f6d1db111202e05da186d2142b364cc (diff) | |
download | nextcloud-server-465767670bef61572bb38cabce901935d9e23e7b.tar.gz nextcloud-server-465767670bef61572bb38cabce901935d9e23e7b.zip |
Check blacklist when renaming files
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r-- | lib/filesystem.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php index 47626c05ae2..e9d2ae93372 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -363,13 +363,21 @@ class OC_Filesystem{ /** * checks if a file is blacklsited for storage in the filesystem + * Listens to write and rename hooks * @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; + if (isset($data['path'])) { + $path = $data['path']; + } else if (isset($data['newpath'])) { + $path = $data['newpath']; + } + if (isset($path)) { + $filename = strtolower(basename($path)); + if (in_array($filename, $blacklist)) { + $data['run'] = false; + } } } |