Use "convertForUriId" when possible

This commit is contained in:
Michael 2021-07-10 07:40:39 +00:00
parent b164910032
commit 9eaa6a2c08
9 changed files with 16 additions and 16 deletions

View file

@ -276,7 +276,7 @@ function wppost_send(&$a, &$b)
// Remove the share element before fetching the first line
$title = trim(preg_replace("/\[share.*?\](.*?)\[\/share\]/ism", "\n$1\n", $b['body']));
$title = HTML::toPlaintext(BBCode::convert($title, false), 0, true)."\n";
$title = BBCode::toPlaintext($title)."\n";
$pos = strpos($title, "\n");
$trailer = "";
if (($pos == 0) || ($pos > 100)) {
@ -289,7 +289,7 @@ function wppost_send(&$a, &$b)
}
$title = '<title>' . (($wptitle) ? $wptitle : DI::l10n()->t('Post from Friendica')) . '</title>';
$post = BBCode::convert($b['body'], false, BBCode::CONNECTORS);
$post = BBCode::convertForUriId($b['uri-id'], $b['body'], BBCode::CONNECTORS);
// If a link goes to youtube then remove the stuff around it. Wordpress detects youtube links and embeds it
$post = preg_replace('/<a.*?href="(https?:\/\/www.youtube.com\/.*?)".*?>(.*?)<\/a>/ism', "\n$1\n", $post);