This commit is contained in:
Daniil Gentili 2017-02-18 17:32:25 +01:00
commit 4a27238af4

View File

@ -419,7 +419,9 @@ trait Extension
{ {
$this->switch_dc($location['dc_id']); $this->switch_dc($location['dc_id']);
$res = $this->method_call('upload.getFile', ['location' => $location, 'offset' => 0, 'limit' => 1], ['heavy' => true]); $res = $this->method_call('upload.getFile', ['location' => $location, 'offset' => 0, 'limit' => 1], ['heavy' => true]);
if (!isset($res['type']['_'])) return $default; if (!isset($res['type']['_'])) {
return $default;
}
switch ($res['type']['_']) { switch ($res['type']['_']) {
case 'storage.fileJpeg': return '.jpg'; case 'storage.fileJpeg': return '.jpg';
case 'storage.fileGif': return '.gif'; case 'storage.fileGif': return '.gif';