summaryrefslogtreecommitdiffstats
path: root/lib/filesystem.php
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-08-11 11:04:04 -0400
committerJörn Friedrich Dreyer <jfd@butonic.de>2012-08-24 15:00:52 +0200
commit12df81fe0ba5229cd9e80c86a960385efd48e459 (patch)
tree02e512aa364fc2b1d834681d8204672f42aca08f /lib/filesystem.php
parent5cb2d58c9f7b2137bf46160eb11ff6e179bd4615 (diff)
downloadnextcloud-server-12df81fe0ba5229cd9e80c86a960385efd48e459.tar.gz
nextcloud-server-12df81fe0ba5229cd9e80c86a960385efd48e459.zip
Check blacklist when renaming files
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r--lib/filesystem.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php
index 2c7df5daa3c..2a0c1cea93e 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -372,13 +372,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;
+ }
}
}