[php] fix #3114 stream proxy function using the file cmd corresponds to range request

This commit is contained in:
nao-pon
2020-02-23 18:23:28 +09:00
parent c2c210c81c
commit 79a838be29
7 changed files with 90 additions and 8 deletions
+3 -3
View File
@@ -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', '<')) {