Check blacklist before saving to filesystem
This commit is contained in:
parent
95c2ac5d58
commit
acdce2b1e0
|
@ -365,6 +365,9 @@ class OC{
|
|||
OC_App::loadApps();
|
||||
}
|
||||
}
|
||||
|
||||
// Check for blacklisted files
|
||||
OC_Hook::connect('OC_Filesystem','write','OC_Filesystem','isBlacklisted');
|
||||
|
||||
//make sure temporary files are cleaned up
|
||||
register_shutdown_function(array('OC_Helper','cleanTmp'));
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue