]> git.mxchange.org Git - friendica.git/commitdiff
ignore tags inside code block
authorfabrixxm <fabrix.xm@gmail.com>
Sun, 22 Mar 2015 16:12:51 +0000 (17:12 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Sun, 22 Mar 2015 16:12:51 +0000 (17:12 +0100)
should fix issue #1041

include/tags.php

index fc1b57db4b9343da5ac0e41735fd6b0eed9d96f0..a8bcae86dcc3783c13bbbc8ab6466517db431f1e 100644 (file)
@@ -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";