Merge pull request #137 from Skehmatics/fix/apostrophe-bug

(Lazily) fix #131 by ignoring hashtags that begin with a ampersand in lexer
pull/199/head
daniel 2018-06-04 22:13:40 -06:00 zatwierdzone przez GitHub
commit 16f4d52476
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
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);