]> git.mxchange.org Git - friendica.git/commitdiff
When converting to HTML, hashtag addresses are now removed (only when the message...
authorMichael Vogel <icarus@dabo.de>
Wed, 15 May 2013 20:20:06 +0000 (22:20 +0200)
committerMichael Vogel <icarus@dabo.de>
Wed, 15 May 2013 20:20:06 +0000 (22:20 +0200)
include/bbcode.php
include/html2plain.php

index 01c8f14df9f1ee9f26784e1fad3531719ecf64da..d16dcb6a7fcf7417a1b3ad9d168ccf10854c52af 100644 (file)
@@ -668,6 +668,12 @@ 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) {
+               $pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
+               $Text = preg_replace($pattern, '#$2', $Text);
+       }
+
        call_hooks('bbcode',$Text);
 
        $a->save_timestamp($stamp1, "parser");
index 1e3f407af494a5e3ab1154c4c05332f296e4c21a..80768ffff7424c2ecd46dce168e01ee313da2c65 100644 (file)
@@ -107,6 +107,10 @@ function html2plain($html, $wraplength = 75, $compact = false)
 
        $message = str_replace("\r", "", $html);
 
+       // replace all hashtag addresses
+       $pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
+       $message = preg_replace($pattern, '#$2', $message);
+
        $doc = new DOMDocument();
        $doc->preserveWhiteSpace = false;