From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Fri, 13 Dec 2019 12:16:43 +0000 (-0500)
Subject: Don't process empty hash tags in Model\Item
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b800083a2b6a3304c390daefdd3710ade1c0edbe;p=friendica.git

Don't process empty hash tags in Model\Item

- Addresses https://github.com/friendica/friendica/issues/7677#issuecomment-565372628
---

diff --git a/src/Model/Item.php b/src/Model/Item.php
index 5427ff44b3..ebee91ffc2 100644
--- a/src/Model/Item.php
+++ b/src/Model/Item.php
@@ -2621,7 +2621,7 @@ class Item extends BaseObject
 				"&num;$2", $item["body"]);
 
 		foreach ($tags as $tag) {
-			if ((strpos($tag, '#') !== 0) || strpos($tag, '[url=') || $tag[1] == '#') {
+			if ((strpos($tag, '#') !== 0) || strpos($tag, '[url=') || strlen($tag) < 2 || $tag[1] == '#') {
 				continue;
 			}