]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Improved definition style
[friendica.git] / src / Model / Item.php
index 5d21cbc790f27f3d01e87aab1d0452bde2a72d95..f6d08047b2f331e3ef20f5f0fccba0893ab27720 100644 (file)
@@ -94,7 +94,8 @@ class Item
        const CONTENT_FIELDLIST = ['language'];
 
        // All fields in the item table
-       const ITEM_FIELDLIST = ['id', 'uid', 'parent', 'uri', 'parent-uri', 'thr-parent', 'guid',
+       const ITEM_FIELDLIST = ['id', 'uid', 'parent', 'uri', 'parent-uri', 'thr-parent',
+                       'guid', 'uri-id', 'parent-uri-id', 'thr-parent-id',
                        'contact-id', 'type', 'wall', 'gravity', 'extid', 'icid', 'iaid', 'psid',
                        'created', 'edited', 'commented', 'received', 'changed', 'verb',
                        'postopts', 'plink', 'resource-id', 'event-id', 'tag', 'attach', 'inform',
@@ -712,7 +713,7 @@ class Item
                        'ignore' => 'event-ignore', 'id' => 'event-id'];
 
                $fields['diaspora-interaction'] = ['interaction', 'interaction' => 'signed_text'];
-                       
+
                return $fields;
        }
 
@@ -2609,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 = "^\[\]";