Merge pull request #681 from annando/master

Remove hashtag links when exporting to other networks
This commit is contained in:
friendica 2013-05-19 02:59:21 -07:00
commit c5ed831b6a
2 changed files with 12 additions and 1 deletions

View file

@ -672,10 +672,15 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
// $Text = mb_convert_encoding($Text, "UTF-8", 'HTML-ENTITIES');
//}
// Remove all hashtag addresses
if (!$tryoembed AND get_config("system", "remove_hashtags_on_export")) {
$pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
$Text = preg_replace($pattern, '#$2', $Text);
}
call_hooks('bbcode',$Text);
$a->save_timestamp($stamp1, "parser");
return $Text;
}

View file

@ -107,6 +107,12 @@ function html2plain($html, $wraplength = 75, $compact = false)
$message = str_replace("\r", "", $html);
// replace all hashtag addresses
if (get_config("system", "remove_hashtags_on_export")) {
$pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
$message = preg_replace($pattern, '#$2', $message);
}
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;