contentが空のときはHTMLとしてのパースを行わないようにする
This commit is contained in:
parent
3cba46bff0
commit
f95f1592f7
@ -73,6 +73,10 @@ class ActivityPubResolver implements Resolver, Parser
|
|||||||
|
|
||||||
private function html2text(string $html): string
|
private function html2text(string $html): string
|
||||||
{
|
{
|
||||||
|
if (empty($html)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
$html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
|
$html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
|
||||||
$html = preg_replace('~<br\s*/?\s*>|</p>\s*<p[^>]*>~i', "\n", $html);
|
$html = preg_replace('~<br\s*/?\s*>|</p>\s*<p[^>]*>~i', "\n", $html);
|
||||||
$dom = new \DOMDocument();
|
$dom = new \DOMDocument();
|
||||||
|
Loading…
Reference in New Issue
Block a user