From 6c2ace3cab93423a4cf05e8b6c1c5ebce5709a86 Mon Sep 17 00:00:00 2001 From: root <17hado.com@gmail.com> Date: Mon, 17 Dec 2018 05:33:03 +0000 Subject: [PATCH] update hashtag regular expression --- include/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index 4bd9e34a3c..4f4f1c5885 100644 --- a/include/api.php +++ b/include/api.php @@ -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`))