diff --git a/js/jquery.dialogelfinder.js b/js/jquery.dialogelfinder.js index ea972d674..5f18c06b6 100644 --- a/js/jquery.dialogelfinder.js +++ b/js/jquery.dialogelfinder.js @@ -1,3 +1,4 @@ + "use strict"; /** * @class dialogelfinder - open elFinder in dialog window @@ -18,6 +19,7 @@ $.fn.dialogelfinder = function(opts) { destroy = 'elfinderDestroyOnClose'; this.not('.elfinder').each(function() { + var doc = $(document), toolbar = $('
'+(opts.title || 'Files')+'
'), @@ -83,5 +85,7 @@ $.fn.dialogelfinder = function(opts) { } } + return this; } + diff --git a/php/connector.php b/php/connector.php index 37ed168ae..f1c526259 100644 --- a/php/connector.php +++ b/php/connector.php @@ -205,34 +205,9 @@ $opts = array( 'imgLib' => 'imagick', # 'tmbURL' => '.tmb/', 'utf8fix' => false, + 'acceptedName' => '/[a-z0-9_\-]+/i', 'attributes' => array( - // array( - // 'pattern' => '/\/__.*/', - // 'hidden' => true - // ), - // array( - // 'pattern' => '/\/\..*$/', - // 'read' => false, - // 'write' => true, - // 'locked' => false, - // 'hidden' => true - // ), - // array( - // 'pattern' => '/folder$/', - // 'read' => false - // // 'write' => false - // ), - // array( - // 'pattern' => '/folder-23$/', - // 'write' => false - // ), - array( - 'pattern' => '/\/folder42$/', - 'write' => false, - // 'read' => false, - // 'hidden' => true, - 'locked' => true - ) + ), ), array( @@ -245,6 +220,7 @@ $opts = array( 'user_id' => 1, 'accessControl' => 'access', 'separator' => ':', + // 'copyTo' => false, // 'URL' => 'http://localhost/git/elfinder', 'tmbPath' => '../files/.dbtmb/', diff --git a/php/elFinderVolumeDriver.class.php b/php/elFinderVolumeDriver.class.php index 366fb05c5..402cdbffe 100644 --- a/php/elFinderVolumeDriver.class.php +++ b/php/elFinderVolumeDriver.class.php @@ -2025,6 +2025,14 @@ abstract class elFinderVolumeDriver { * @author Dmitry (dio) Levashov **/ protected function doRm($path) { + + //https://github.com/Studio-42/elFinder/issues/40 + // file_exists() return false on symlink points to itself + if ($this->_isLink($path)) { + $this->rmTmb($path); + return $this->_unlink($path); + } + if (!$this->_fileExists($path)) { return $this->setError(elFinder::ERROR_FILE_NOT_FOUND); } @@ -2036,7 +2044,7 @@ abstract class elFinderVolumeDriver { return $this->setError(elFinder::ERROR_LOCKED, $name); } - if ($this->_isLink($path) || $this->_isFile($path)) { + if ($this->_isFile($path)) { $this->rmTmb($path); return $this->_unlink($path); } elseif ($this->_isDir($path)) {