Merge pull request #681 from annando/master
Remove hashtag links when exporting to other networks
This commit is contained in:
commit
c5ed831b6a
2 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue