]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Improved definition style
[friendica.git] / src / Model / Item.php
index 1f2faa2698293cb9f97804f56947d2fa0a5b8213..f6d08047b2f331e3ef20f5f0fccba0893ab27720 100644 (file)
@@ -2610,7 +2610,10 @@ class Item
 
                // This sorting is important when there are hashtags that are part of other hashtags
                // Otherwise there could be problems with hashtags like #test and #test2
-               rsort($tags);
+               // Because of this we are sorting from the longest to the shortest tag.
+               usort($tags, function($a, $b) {
+                       return strlen($b) <=> strlen($a);
+               });
 
                $URLSearchString = "^\[\]";