mirror of
https://github.com/danog/MadelineProto.git
synced 2024-12-02 18:47:52 +01:00
This commit is contained in:
parent
5572c2dbe1
commit
1f661441bf
@ -111,8 +111,6 @@ abstract class MsgIdHandler
|
|||||||
*/
|
*/
|
||||||
public static function toString(string $messageId): string
|
public static function toString(string $messageId): string
|
||||||
{
|
{
|
||||||
return PHP_INT_SIZE === 8
|
return MsgIdHandler64::toStringInternal($messageId);
|
||||||
? MsgIdHandler64::toStringInternal($messageId)
|
|
||||||
: MsgIdHandler32::toStringInternal($messageId);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1014,9 +1014,14 @@ abstract class Tools extends StrTools
|
|||||||
*/
|
*/
|
||||||
public static function parseLink(string $link): ?array
|
public static function parseLink(string $link): ?array
|
||||||
{
|
{
|
||||||
if (!\preg_match('@(?:t|telegram)\\.(?:me|dog)/(joinchat/|\+)?([a-z0-9_-]*)@i', $link, $matches)) {
|
if (\preg_match('@([a-z0-9_-]*)\\.(?:t|telegram)\.(?:me|dog)@', $link, $matches)) {
|
||||||
return null;
|
if ($link !== 'www') {
|
||||||
|
return [false, $matches[1]];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (\preg_match('@(?:t|telegram)\\.(?:me|dog)/(joinchat/|\+)?([a-z0-9_-]*)@i', $link, $matches)) {
|
||||||
return [!!$matches[1], $matches[2]];
|
return [!!$matches[1], $matches[2]];
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user