This commit is contained in:
Daniil Gentili 2017-08-28 11:45:25 +02:00
parent c70f5da7bd
commit e2e0c775e7
2 changed files with 4 additions and 2 deletions

View File

@ -233,11 +233,11 @@ trait Files
public function download_to_file($message_media, $file, $cb = null)
{
$file = realpath($file);
$message_media = $this->get_download_info($message_media);
if (!file_exists($file)) {
touch($file);
}
$file = realpath($file);
$message_media = $this->get_download_info($message_media);
$stream = fopen($file, 'r+b');
flock($stream, LOCK_EX);
$this->download_to_stream($message_media, $stream, $cb, filesize($file), -1);

View File

@ -73,6 +73,8 @@ class Serialization
try {
$unserialized = unserialize($tounserialize);
} catch (\danog\MadelineProto\Bug74586Exception $e) {
$unserialized = \danog\Serialization::unserialize($tounserialize);
} catch (\danog\MadelineProto\Exception $e) {
$unserialized = \danog\Serialization::unserialize($tounserialize);
}