]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Post/Content.php
Issue 9948: Remove "@" from full text search
[friendica.git] / src / Model / Post / Content.php
index 80eacf9d7a8bfc095159f545450d631a0d7c5609..7a5dd797dd42a9a0d6e931ae36693469ed01de17 100644 (file)
@@ -110,7 +110,7 @@ class Content
        {
                $condition = ["`uri-id` IN (SELECT `uri-id` FROM `post-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE))
                        AND (`uid` = ? OR (`uid` = ? AND NOT `global`)) AND (`network` IN (?, ?, ?, ?) OR (`uid` = ? AND `uid` != ?))",
-                       $search, 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
+                       str_replace('@', ' ', $search), 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
 
                if (!empty($last_uriid)) {
                        $condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $last_uriid]);
@@ -136,7 +136,7 @@ class Content
        {
                $condition = ["`uri-id` IN (SELECT `uri-id` FROM `post-content` WHERE MATCH (`title`, `content-warning`, `body`) AGAINST (? IN BOOLEAN MODE))
                        AND (`uid` = ? OR (`uid` = ? AND NOT `global`)) AND (`network` IN (?, ?, ?, ?) OR (`uid` = ? AND `uid` != ?))",
-                       $search, 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
+                       str_replace('@', ' ', $search), 0, $uid, Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS, $uid, 0];
                return Post::count($condition);
        }
 }