]> git.mxchange.org Git - friendica.git/blobdiff - include/api.php
update hashtag regular expression
[friendica.git] / include / api.php
index 4bd9e34a3c5cfa9bbd3b18704aa03b7bc7a785c3..4f4f1c58856fe1df7a24e782bcd79cef4356f695 100644 (file)
@@ -1538,7 +1538,7 @@ function api_search($type)
        $page = (!empty($_REQUEST['page']) ? $_REQUEST['page'] - 1 : 0);
        $start = $page * $count;
        $params = ['order' => ['id' => true], 'limit' => [$start, $count]];
-       if (preg_match('/^\#([^#]+)/', $searchTerm, $matches) === 1 && isset($matches[1])) {
+       if (preg_match('/^#(\w+)$/', $searchTerm, $matches) === 1 && isset($matches[1])) {
                $searchTerm = $matches[1];
                $condition = ["`oid` > ?
                        AND (`uid` = 0 OR (`uid` = ? AND NOT `global`))