Skip to content

Commit

Permalink
[VD:GoogleDrive] to support item name with "/" in name
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Mar 1, 2020
1 parent 083978c commit 7c834f0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions php/elFinderVolumeGoogleDrive.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ protected function _gd_splitPath($path)
$id = 'root';
$parent = '';
} else {
$path = str_replace('\\/', chr(7), $path);
$paths = explode('/', $path);
$id = array_pop($paths);
$id = str_replace(chr(7), '/', $id);
debug($id);
if ($paths) {
$parent = '/' . implode('/', $paths);
$pid = array_pop($paths);
Expand Down Expand Up @@ -1718,7 +1721,7 @@ protected function _fclose($fp, $path = '')
**/
protected function _mkdir($path, $name)
{
$path = $this->_joinPath($path, $name);
$path = $this->_joinPath($path, str_replace('/', '\\/', $name));
list($parentId, , $parent) = $this->_gd_splitPath($path);

try {
Expand Down Expand Up @@ -1898,7 +1901,7 @@ protected function _rmdir($path)
protected function _save($fp, $path, $name, $stat)
{
if ($name !== '') {
$path .= '/' . $name;
$path .= '/' . str_replace('/', '\\/', $name);
}
list($parentId, $itemId, $parent) = $this->_gd_splitPath($path);
if ($name === '') {
Expand Down

0 comments on commit 7c834f0

Please sign in to comment.