1
0
Fork 0

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

(Lazily) fix #131 by ignoring hashtags that begin with a ampersand in lexer
This commit is contained in:
daniel 2018-06-04 22:13:40 -06:00 committed by GitHub
commit 16f4d52476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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);