]> git.mxchange.org Git - friendica.git/commitdiff
Trim the tag
authorMichael <heluecht@pirati.ca>
Mon, 28 Nov 2022 04:04:27 +0000 (04:04 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Nov 2022 04:04:27 +0000 (04:04 +0000)
src/Module/Api/Mastodon/Tags/Follow.php
src/Module/Api/Mastodon/Tags/Unfollow.php

index e2261f3fd50869819f03b5b52376cf3f25933d44..767245b60f49ce087bdace646764d601cc607c66 100644 (file)
@@ -40,7 +40,7 @@ class Follow extends BaseApi
                        DI::mstdnError()->UnprocessableEntity();
                }
 
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $fields = ['uid' => $uid, 'term' => '#' . $this->parameters['hashtag']];
+               $fields = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')];
                if (!DBA::exists('search', $fields)) {
                        DBA::insert('search', $fields);
                }
                if (!DBA::exists('search', $fields)) {
                        DBA::insert('search', $fields);
                }
index 465c1974b59452cf7a7a00aa89f630fad7a69d33..163b65003b4285690d242e6cd7f654e62882b678 100644 (file)
@@ -40,7 +40,7 @@ class Unfollow extends BaseApi
                        DI::mstdnError()->UnprocessableEntity();
                }
 
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               $term = ['uid' => $uid, 'term' => '#' . $this->parameters['hashtag']];
+               $term = ['uid' => $uid, 'term' => '#' . ltrim($this->parameters['hashtag'], '#')];
 
                DBA::delete('search', $term);
 
 
                DBA::delete('search', $term);