Update Hashtag limit

This commit is contained in:
Daniel Supernault 2019-07-01 21:52:29 -06:00
parent 09361db173
commit 7591eadbd1
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 6 additions and 1 deletions

View file

@ -89,6 +89,9 @@ class StatusEntityLexer implements ShouldQueue
$status = $this->status; $status = $this->status;
foreach ($tags as $tag) { foreach ($tags as $tag) {
if(mb_strlen($tag) > 124) {
continue;
}
DB::transaction(function () use ($status, $tag) { DB::transaction(function () use ($status, $tag) {
$slug = str_slug($tag, '-', false); $slug = str_slug($tag, '-', false);
$hashtag = Hashtag::firstOrCreate( $hashtag = Hashtag::firstOrCreate(

View file

@ -264,7 +264,9 @@ class Extractor extends Regex
if (preg_match(self::$patterns['end_hashtag_match'], $outer[0])) { if (preg_match(self::$patterns['end_hashtag_match'], $outer[0])) {
continue; continue;
} }
if(mb_strlen($hashtag[0]) > 124) {
continue;
}
$tags[] = [ $tags[] = [
'hashtag' => $hashtag[0], 'hashtag' => $hashtag[0],
'indices' => [$start_position, $end_position], 'indices' => [$start_position, $end_position],