Remove stored URL from hashtag terms

This commit is contained in:
Hypolite Petovan 2018-11-22 09:33:42 -05:00
parent 4874f7f8ab
commit 81f89ccae8
2 changed files with 6 additions and 4 deletions

View File

@ -170,7 +170,7 @@ EOT;
$term_objtype, $term_objtype,
TERM_HASHTAG, TERM_HASHTAG,
DBA::escape($term), DBA::escape($term),
DBA::escape(System::baseUrl() . '/search?tag=' . $term), '',
intval($owner_uid) intval($owner_uid)
); );
} }
@ -192,7 +192,7 @@ EOT;
$term_objtype, $term_objtype,
TERM_HASHTAG, TERM_HASHTAG,
DBA::escape($term), DBA::escape($term),
DBA::escape(System::baseUrl() . '/search?tag=' . $term), '',
intval($owner_uid) intval($owner_uid)
); );
} }

View File

@ -140,6 +140,7 @@ class Term
$type = TERM_HASHTAG; $type = TERM_HASHTAG;
$term = substr($tag, 1); $term = substr($tag, 1);
$link = '';
} elseif ((substr(trim($tag), 0, 1) == '@') || (substr(trim($tag), 0, 1) == '!')) { } elseif ((substr(trim($tag), 0, 1) == '@') || (substr(trim($tag), 0, 1) == '!')) {
$type = TERM_MENTION; $type = TERM_MENTION;
@ -152,6 +153,7 @@ class Term
} else { // This shouldn't happen } else { // This shouldn't happen
$type = TERM_HASHTAG; $type = TERM_HASHTAG;
$term = $tag; $term = $tag;
$link = '';
} }
if (DBA::exists('term', ['uid' => $message['uid'], 'otype' => TERM_OBJ_POST, 'oid' => $itemid, 'url' => $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)) { while ($tag = DBA::fetch($taglist)) {
if ($tag["url"] == "") { if ($tag['url'] == '') {
$tag["url"] = $searchpath . $tag["term"]; $tag['url'] = $searchpath . rawurlencode($tag['term']);
} }
$orig_tag = $tag['url']; $orig_tag = $tag['url'];