Skip to content

Commit

Permalink
[connector:php:local] options quarantine allows path
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Dec 21, 2014
1 parent 6a8e40f commit fcaaf63
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions php/elFinderVolumeLocalFileSystem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ protected function configure() {
$this->aroot = realpath($this->root);
$root = $this->stat($this->root);

if ($this->options['quarantine']) {
$this->attributes[] = array(
'pattern' => '~^'.preg_quote(DIRECTORY_SEPARATOR.$this->options['quarantine']).'$~',
'read' => false,
'write' => false,
'locked' => true,
'hidden' => true
);
}

// chek thumbnails path
if ($this->options['tmbPath']) {
$this->options['tmbPath'] = strpos($this->options['tmbPath'], DIRECTORY_SEPARATOR) === false
Expand All @@ -92,17 +82,35 @@ protected function configure() {
}

// check quarantine dir
$this->quarantine = '';
if (!empty($this->options['quarantine'])) {
$this->quarantine = $this->root.DIRECTORY_SEPARATOR.$this->options['quarantine'];
if ((!is_dir($this->quarantine) && !$this->_mkdir($this->root, $this->options['quarantine'])) || !is_writable($this->quarantine)) {
$this->archivers['extract'] = array();
$this->disabled[] = 'extract';
if ($this->options['quarantine'] !== basename($this->options['quarantine'])) {
if (is_dir($this->options['quarantine']) && is_writable($this->options['quarantine'])) {
$this->quarantine = $this->options['quarantine'];
}
$this->options['quarantine'] = '';
} else {
$this->quarantine = $this->root.DIRECTORY_SEPARATOR.$this->options['quarantine'];
if ((!is_dir($this->quarantine) && !$this->_mkdir($this->root, $this->options['quarantine'])) || !is_writable($this->quarantine)) {
$this->options['quarantine'] = $this->quarantine = '';
}
}
} else {
}

if (!$this->quarantine) {
$this->archivers['extract'] = array();
$this->disabled[] = 'extract';
}

if ($this->options['quarantine']) {
$this->attributes[] = array(
'pattern' => '~^'.preg_quote(DIRECTORY_SEPARATOR.$this->options['quarantine']).'$~',
'read' => false,
'write' => false,
'locked' => true,
'hidden' => true
);
}
}

/*********************************************************************/
Expand Down

0 comments on commit fcaaf63

Please sign in to comment.