Bugfix
This commit is contained in:
parent
8358a58839
commit
3ceb34c3b0
@ -28,7 +28,7 @@ class Exception extends \Exception
|
||||
if (\danog\MadelineProto\Logger::$constructed) {
|
||||
\danog\MadelineProto\Logger::log([$errstr.' in '.basename($errfile).':'.$errline], \danog\MadelineProto\Logger::FATAL_ERROR);
|
||||
}
|
||||
$e = new \danog\MadelineProto\Exception($errstr, $errno);
|
||||
$e = new self($errstr, $errno);
|
||||
$e->file = $errfile;
|
||||
$e->line = $errline;
|
||||
throw $e;
|
||||
|
@ -180,13 +180,13 @@ trait PeerHandler
|
||||
}
|
||||
|
||||
if (preg_match('/^channel#/', $id)) {
|
||||
$id = str_replace('channel#', '-100', $id);
|
||||
$id = preg_replace('|\D+|', '-100', $id);
|
||||
}
|
||||
if (preg_match('/^chat#/', $id)) {
|
||||
$id = str_replace('chat#', '-', $id);
|
||||
$id = preg_replace('|\D+|', '-', $id);
|
||||
}
|
||||
if (preg_match('/^user#/', $id)) {
|
||||
$id = str_replace('user#', '', $id);
|
||||
$id = preg_replace('|\D+|', '', $id);
|
||||
}
|
||||
|
||||
if (is_numeric($id)) {
|
||||
|
@ -419,6 +419,7 @@ trait Extension
|
||||
{
|
||||
$this->switch_dc($location['dc_id']);
|
||||
$res = $this->method_call('upload.getFile', ['location' => $location, 'offset' => 0, 'limit' => 1], ['heavy' => true]);
|
||||
if (!isset($res['type']['_'])) return $default;
|
||||
switch ($res['type']['_']) {
|
||||
case 'storage.fileJpeg': return '.jpg';
|
||||
case 'storage.fileGif': return '.gif';
|
||||
|
Loading…
Reference in New Issue
Block a user