]> git.mxchange.org Git - friendica.git/commitdiff
Remove stored URL from hashtag terms
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 22 Nov 2018 14:33:42 +0000 (09:33 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 22 Nov 2018 14:33:42 +0000 (09:33 -0500)
mod/tagger.php
src/Model/Term.php

index 09668cd6de23ff7e21d60a8450e92fa8a39c1ade..5a8047414d648fc1c1d34771e971205fad832de3 100644 (file)
@@ -170,7 +170,7 @@ EOT;
                   $term_objtype,
                   TERM_HASHTAG,
                   DBA::escape($term),
-                  DBA::escape(System::baseUrl() . '/search?tag=' . $term),
+                  '',
                   intval($owner_uid)
                );
        }
@@ -192,7 +192,7 @@ EOT;
                                $term_objtype,
                                TERM_HASHTAG,
                                DBA::escape($term),
-                               DBA::escape(System::baseUrl() . '/search?tag=' . $term),
+                               '',
                                intval($owner_uid)
                        );
                }
index da07659b4e3289f2575210ec6818d0f7a2c4e117..3718887122436ad35784b0f7b1f3b7cc8fc91620 100644 (file)
@@ -140,6 +140,7 @@ class Term
 
                                $type = TERM_HASHTAG;
                                $term = substr($tag, 1);
+                               $link = '';
                        } elseif ((substr(trim($tag), 0, 1) == '@') || (substr(trim($tag), 0, 1) == '!')) {
                                $type = TERM_MENTION;
 
@@ -152,6 +153,7 @@ class Term
                        } else { // This shouldn't happen
                                $type = TERM_HASHTAG;
                                $term = $tag;
+                               $link = '';
                        }
 
                        if (DBA::exists('term', ['uid' => $message['uid'], 'otype' => TERM_OBJ_POST, 'oid' => $itemid, 'url' => $link])) {
@@ -262,8 +264,8 @@ class Term
                );
 
                while ($tag = DBA::fetch($taglist)) {
-                       if ($tag["url"] == "") {
-                               $tag["url"] = $searchpath . $tag["term"];
+                       if ($tag['url'] == '') {
+                               $tag['url'] = $searchpath . rawurlencode($tag['term']);
                        }
 
                        $orig_tag = $tag['url'];