Merge branch 'master' into develop
This commit is contained in:
commit
56b9117a20
@ -960,11 +960,6 @@ function transload($url, $mfile) {
|
|||||||
fwrite($fp, $data);
|
fwrite($fp, $data);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
|
|
||||||
//
|
|
||||||
// Scrutinizer-ci complains that $http_response_header does not exist,
|
|
||||||
// however, $http_response_header is actually a super-global.
|
|
||||||
// I have filed a bug with PHP-Analyzer here: https://github.com/scrutinizer-ci/php-analyzer/issues/212
|
|
||||||
//
|
|
||||||
$headers = http_parse_headers(implode("\n", $http_response_header));
|
$headers = http_parse_headers(implode("\n", $http_response_header));
|
||||||
|
|
||||||
return $headers;
|
return $headers;
|
||||||
|
@ -364,9 +364,10 @@ class Upload extends Extension {
|
|||||||
|
|
||||||
$tmp_filename = tempnam(ini_get('upload_tmp_dir'), "shimmie_transload");
|
$tmp_filename = tempnam(ini_get('upload_tmp_dir'), "shimmie_transload");
|
||||||
|
|
||||||
|
// transload() returns Array or Bool, depending on the transload_engine.
|
||||||
$headers = transload($url, $tmp_filename);
|
$headers = transload($url, $tmp_filename);
|
||||||
|
|
||||||
$s_filename = findHeader($headers, 'Content-Disposition');
|
$s_filename = is_array($headers) ? findHeader($headers, 'Content-Disposition') : null;
|
||||||
$h_filename = ($s_filename ? preg_replace('/^.*filename="([^ ]+)"/i', '$1', $s_filename) : null);
|
$h_filename = ($s_filename ? preg_replace('/^.*filename="([^ ]+)"/i', '$1', $s_filename) : null);
|
||||||
$filename = $h_filename ?: basename($url);
|
$filename = $h_filename ?: basename($url);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user