]> git.mxchange.org Git - friendica.git/blobdiff - include/tags.php
Fixes for #3010:
[friendica.git] / include / tags.php
index fc1b57db4b9343da5ac0e41735fd6b0eed9d96f0..6c1d01d74da5063e6b167d3388b1a03b4b913813 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 function create_tags_from_item($itemid) {
-       global $a;
+       $a = get_app();
 
        $profile_base = $a->get_baseurl();
        $profile_data = parse_url($profile_base);
@@ -37,6 +37,9 @@ function create_tags_from_item($itemid) {
 
        $data = " ".$message["title"]." ".$message["body"]." ".$tags." ";
 
+       // ignore anything in a code block
+       $data = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$data);
+
        $tags = array();
 
        $pattern = "/\W\#([^\[].*?)[\s'\".,:;\?!\[\]\/]/ism";