diff --git a/src/danog/MadelineProto/TL/Conversion/BotAPI.php b/src/danog/MadelineProto/TL/Conversion/BotAPI.php index 99d4bd474..20e975edd 100644 --- a/src/danog/MadelineProto/TL/Conversion/BotAPI.php +++ b/src/danog/MadelineProto/TL/Conversion/BotAPI.php @@ -393,7 +393,7 @@ trait BotAPI } else { $entities[] = ['_' => 'messageEntityTextUrl', 'offset' => mb_strlen($new_message), 'length' => mb_strlen($text), 'url' => $href]; } - + $new_message .= $text; break; default: @@ -414,21 +414,20 @@ trait BotAPI if (preg_match('/html/i', $arguments['parse_mode'])) { $new_message = ''; - - $arguments['message'] = $this->html_fixtags($arguments['message']); - $dom = new \DOMDocument(); - $dom->loadHTML(mb_convert_encoding($arguments['message'], 'HTML-ENTITIES', 'UTF-8')); - if (!isset($arguments['entities'])) { - $arguments['entities'] = []; - } - foreach ($dom->getElementsByTagName('body')->item(0)->childNodes as $node) { - $this->parse_node($node, $arguments['entities'], $new_message); - } - if (isset($arguments['entities']['buttons'])) { - $arguments['reply_markup'] = $this->build_rows($arguments['entities']['buttons']); - unset($arguments['entities']['buttons']); - } - unset($arguments['parse_mode']); + $arguments['message'] = $this->html_fixtags($arguments['message']); + $dom = new \DOMDocument(); + $dom->loadHTML(mb_convert_encoding($arguments['message'], 'HTML-ENTITIES', 'UTF-8')); + if (!isset($arguments['entities'])) { + $arguments['entities'] = []; + } + foreach ($dom->getElementsByTagName('body')->item(0)->childNodes as $node) { + $this->parse_node($node, $arguments['entities'], $new_message); + } + if (isset($arguments['entities']['buttons'])) { + $arguments['reply_markup'] = $this->build_rows($arguments['entities']['buttons']); + unset($arguments['entities']['buttons']); + } + unset($arguments['parse_mode']); $arguments['message'] = $new_message; }