Ignore hashtags that begin with a ampersand

Fixes #131

This is usually a marker of an HTML entity code.
It is possible for a user to do this on purpose,
but not horribly likely.

i hope
pull/137/head
Derek Schmidt 2018-06-01 23:58:23 -07:00
rodzic ae6a59e782
commit 41683db2b4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 0F5D491793B4035A
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -7,7 +7,7 @@ class Hashtag {
public static function getHashtags($status)
{
$hashtags = false;
preg_match_all("/(#\w+)/u", $status, $matches);
preg_match_all("/(?<!&)(#\w+)/u", $status, $matches);
if ($matches) {
$res = array_count_values($matches[0]);
$hashtags = array_keys($res);