Apply fixes from StyleCI
This commit is contained in:
parent
f2d107df90
commit
c39b28122b
@ -414,21 +414,20 @@ trait BotAPI
|
|||||||
if (preg_match('/html/i', $arguments['parse_mode'])) {
|
if (preg_match('/html/i', $arguments['parse_mode'])) {
|
||||||
$new_message = '';
|
$new_message = '';
|
||||||
|
|
||||||
|
$arguments['message'] = $this->html_fixtags($arguments['message']);
|
||||||
$arguments['message'] = $this->html_fixtags($arguments['message']);
|
$dom = new \DOMDocument();
|
||||||
$dom = new \DOMDocument();
|
$dom->loadHTML(mb_convert_encoding($arguments['message'], 'HTML-ENTITIES', 'UTF-8'));
|
||||||
$dom->loadHTML(mb_convert_encoding($arguments['message'], 'HTML-ENTITIES', 'UTF-8'));
|
if (!isset($arguments['entities'])) {
|
||||||
if (!isset($arguments['entities'])) {
|
$arguments['entities'] = [];
|
||||||
$arguments['entities'] = [];
|
}
|
||||||
}
|
foreach ($dom->getElementsByTagName('body')->item(0)->childNodes as $node) {
|
||||||
foreach ($dom->getElementsByTagName('body')->item(0)->childNodes as $node) {
|
$this->parse_node($node, $arguments['entities'], $new_message);
|
||||||
$this->parse_node($node, $arguments['entities'], $new_message);
|
}
|
||||||
}
|
if (isset($arguments['entities']['buttons'])) {
|
||||||
if (isset($arguments['entities']['buttons'])) {
|
$arguments['reply_markup'] = $this->build_rows($arguments['entities']['buttons']);
|
||||||
$arguments['reply_markup'] = $this->build_rows($arguments['entities']['buttons']);
|
unset($arguments['entities']['buttons']);
|
||||||
unset($arguments['entities']['buttons']);
|
}
|
||||||
}
|
unset($arguments['parse_mode']);
|
||||||
unset($arguments['parse_mode']);
|
|
||||||
$arguments['message'] = $new_message;
|
$arguments['message'] = $new_message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user