1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
facebook.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\UrlPreview\Parser;
4
5use Bitrix\Main\UrlPreview\HtmlDocument;
6use Bitrix\Main\Web\HttpClient;
7
8class Facebook extends Oembed
9{
10 public function handle(HtmlDocument $document, HttpClient $httpClient = null)
11 {
12 parent::handle($document);
13
14 if($document->getEmdbed())
15 {
16 $embedHtml = $document->getEmdbed();
17
18 preg_match('/<div(?:.+?)fb-post(.+?)>/i', $embedHtml, $divTags);
19
20 if($divTags[0])
21 {
22 $div = str_replace('>', ' data-show-text="false">', $divTags[0]);
23 $embedHtml = str_replace($divTags[0], $div, $embedHtml);
24 $document->setEmbed($embedHtml);
25 }
26 }
27 }
28}
handle(HtmlDocument $document, HttpClient $httpClient=null)
Определения facebook.php:10