mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[php] fix #3114 stream proxy function using the file cmd corresponds to range request
This commit is contained in:
@@ -219,7 +219,7 @@ class elFinderConnector
|
||||
$sendData = !($this->reqMethod === 'HEAD' || !empty($data['info']['xsendfile']));
|
||||
$psize = null;
|
||||
if (($this->reqMethod === 'GET' || !$sendData)
|
||||
&& elFinder::isSeekableStream($fp)
|
||||
&& (elFinder::isSeekableStream($fp) || elFinder::isSeekableUrl($fp))
|
||||
&& (array_search('Accept-Ranges: none', headers_list()) === false)) {
|
||||
header('Accept-Ranges: bytes');
|
||||
if (!empty($_SERVER['HTTP_RANGE'])) {
|
||||
@@ -258,7 +258,7 @@ class elFinderConnector
|
||||
}
|
||||
}
|
||||
|
||||
$sendData && fseek($fp, $start);
|
||||
$sendData && !elFinder::isSeekableUrl($fp) && fseek($fp, $start);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -277,7 +277,7 @@ class elFinderConnector
|
||||
}
|
||||
|
||||
if ($sendData) {
|
||||
if ($toEnd) {
|
||||
if ($toEnd || elFinder::isSeekableUrl($fp)) {
|
||||
// PHP < 5.6 has a bug of fpassthru
|
||||
// see https://bugs.php.net/bug.php?id=66736
|
||||
if (version_compare(PHP_VERSION, '5.6', '<')) {
|
||||
|
||||
Reference in New Issue
Block a user