Skip to content

Commit

Permalink
[VD:abstract,LocalFileSystem] fix #1744 results url must be urlencoded
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Nov 14, 2016
1 parent ac1a907 commit a12ea6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions php/elFinderVolumeDriver.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4090,6 +4090,8 @@ protected function doSearch($path, $q, $mimes) {
$path = str_replace($this->separator, '/', substr($p, strlen($this->root) + 1));
if ($this->encoding) {
$path = str_replace('%2F', '/', rawurlencode($this->convEncIn($path, true)));
} else {
$path = str_replace('%2F', '/', rawurlencode($path));
}
$stat['url'] = $this->URL . $path;
}
Expand Down
2 changes: 1 addition & 1 deletion php/elFinderVolumeLocalFileSystem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ protected function doSearch($path, $q, $mimes) {
$stat['path'] = $this->path($stat['hash']);
if ($this->URL && !isset($stat['url'])) {
$_path = str_replace(DIRECTORY_SEPARATOR, '/', substr($p, strlen($this->root) + 1));
$stat['url'] = $this->URL . $_path;
$stat['url'] = $this->URL . str_replace('%2F', '/', rawurlencode($_path));
}

$result[] = $stat;
Expand Down

0 comments on commit a12ea6e

Please sign in to comment.