From: fabrixxm <fabrix.xm@gmail.com>
Date: Sun, 22 Mar 2015 16:12:51 +0000 (+0100)
Subject: ignore tags inside code block
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a98d2ee3872ac422ea2e45d2f2023f76d65ad60b;p=friendica.git

ignore tags inside code block
should fix issue #1041
---

diff --git a/include/tags.php b/include/tags.php
index fc1b57db4b..a8bcae86dc 100644
--- a/include/tags.php
+++ b/include/tags.php
@@ -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";