src build elFinder-2.1-0f82e69

This commit is contained in:
nao-pon
2017-07-05 13:30:08 +09:00
parent 3676017ae6
commit 995f71d3a4
7 changed files with 41 additions and 13 deletions
+16 -5
View File
@@ -186,8 +186,8 @@ class elFinderConnector {
$toEnd = true;
$fp = $data['pointer'];
$isHEAD = ($this->reqMethod === 'HEAD');
if (($this->reqMethod === 'GET' || $isHEAD)
$sendData = !($this->reqMethod === 'HEAD' || !empty($data['info']['xsendfile']));
if (($this->reqMethod === 'GET' || !$sendData)
&& elFinder::isSeekableStream($fp)
&& (array_search('Accept-Ranges: none', headers_list()) === false)) {
header('Accept-Ranges: bytes');
@@ -216,11 +216,22 @@ class elFinderConnector {
header('Content-Length: ' . $psize);
header('Content-Range: bytes ' . $start . '-' . $end . '/' . $size);
!$isHEAD && fseek($fp, $start);
$sendData && fseek($fp, $start);
}
}
if (isset($data['info']['xsendfile']) && strtolower($data['info']['xsendfile']) === 'x-sendfile') {
if (function_exists('header_remove')) {
header_remove($data['info']['xsendfile']);
} else {
header($data['info']['xsendfile'] . ':');
}
unset($data['info']['xsendfile']);
if ($this->reqMethod !== 'HEAD') {
$sendData = true;
}
}
}
if (!$isHEAD && is_null($psize)){
if ($sendData && is_null($psize)){
elFinder::rewind($fp);
}
} else {
@@ -234,7 +245,7 @@ class elFinderConnector {
}
}
if (!$isHEAD) {
if ($sendData) {
if ($toEnd) {
fpassthru($fp);
} else {