Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Update plugin.php
Browse files Browse the repository at this point in the history
Fixed bug related to the fact that relativePath can't always return the path to a large file (>2gb).
Because of this, the correct file paths were only displayed for small files.
It is checked on a router with Linux
  • Loading branch information
RuslanOnyshchenko committed May 16, 2018
1 parent f3c2843 commit 5261dff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ForkPlayer/Plugins/Local/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function dispatch($context)
*/
private function readDir($context, $basePath) {
$dir = dir(realpath($basePath));

$curdir = realpath($dir->path);
$items = array();

while (false !== ($filename = $dir->read())) {
Expand All @@ -83,7 +83,7 @@ private function readDir($context, $basePath) {
new Item(
$filename,
'',
$context->getRequest()->absoluteUrl($this->urlRoot . '/' . ($this->relativePath($path))),
$context->getRequest()->absoluteUrl($this->urlRoot . '/' . ($this->relativePath($curdir).'/'.$filename)),
'',
ItemType::from(ItemType::FILE)
)
Expand Down Expand Up @@ -118,4 +118,4 @@ private function relativePath($path) {

return str_replace($root, '', $fullPath);
}
}
}

0 comments on commit 5261dff

Please sign in to comment.