check code rights on cloud files
This commit is contained in:
@@ -254,7 +254,7 @@ class File extends DAV\Node implements DAV\IFile {
|
||||
// @todo this should be a global definition
|
||||
$unsafe_types = array('text/html', 'text/css', 'application/javascript');
|
||||
|
||||
if (in_array($r[0]['filetype'], $unsafe_types)) {
|
||||
if (in_array($r[0]['filetype'], $unsafe_types) && (! channel_codeallowed($this->data['uid']))) {
|
||||
header('Content-disposition: attachment; filename="' . $r[0]['filename'] . '"');
|
||||
header('Content-type: text/plain');
|
||||
}
|
||||
@@ -300,7 +300,7 @@ class File extends DAV\Node implements DAV\IFile {
|
||||
public function getContentType() {
|
||||
// @todo this should be a global definition.
|
||||
$unsafe_types = array('text/html', 'text/css', 'application/javascript');
|
||||
if (in_array($this->data['filetype'], $unsafe_types)) {
|
||||
if (in_array($this->data['filetype'], $unsafe_types) && (! channel_codeallowed($this->data['uid']))) {
|
||||
return 'text/plain';
|
||||
}
|
||||
return $this->data['filetype'];
|
||||
|
Reference in New Issue
Block a user