Skip to content

Commit

Permalink
[php:core] fix #1572 unable to DnD upload the folder named "0"
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Aug 5, 2016
1 parent 5382b08 commit 1cb4064
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions php/elFinder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2187,7 +2187,7 @@ protected function upload($args) {
}

$tmpname = $files['tmp_name'][$i];
$path = ($paths && !empty($paths[$i]))? $paths[$i] : '';
$path = ($paths && isset($paths[$i]))? $paths[$i] : '';
$mtime = isset($mtimes[$i])? $mtimes[$i] : 0;
if ($name === 'blob') {
if ($chunk) {
Expand Down Expand Up @@ -2239,7 +2239,7 @@ protected function upload($args) {
break;
}
$rnres = array();
if ($path && $path !== $target) {
if ($path !== '' && $path !== $target) {
if ($dir = $volume->dir($path)) {
$_target = $path;
if (! isset($addedDirs[$path])) {
Expand Down Expand Up @@ -2874,6 +2874,7 @@ protected function getNetVolumeUniqueId($netVolumes = null, $prefix = 'nm') {
protected function ensureDirsRecursively($volume, $target, $dirs, $path = '') {
$res = array('stats' => array(), 'hashes' => array());
foreach($dirs as $name => $sub) {
$name = (string)$name;
if ((($parent = $volume->realpath($target)) && ($dir = $volume->dir($volume->getHash($parent, $name)))) || ($dir = $volume->mkdir($target, $name))) {
$_path = $path . '/' . $name;
$res['stats'][] = $dir;
Expand Down

0 comments on commit 1cb4064

Please sign in to comment.