Skip to content

Commit

Permalink
fix: fix regex escaping issue in php7.3 (#270)
Browse files Browse the repository at this point in the history
See #250
  • Loading branch information
atymic authored Nov 7, 2019
1 parent 06bdb51 commit db54815
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Thujohn/Twitter/Twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function linkify($tweet)
$patterns['url'] = '(?xi)\b((?:https?://|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:\'".,<>?«»“”‘’]))';
$patterns['mailto'] = '([_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3}))';
$patterns['user'] = ' +@([a-z0-9_]*)?';
$patterns['hashtag'] = '(?:(?<=\s)|^)#(\w*[\p{L}-\d\p{Cyrillic}\d]+\w*)';
$patterns['hashtag'] = '(?:(?<=\s)|^)#(\w*[\p{L}\-\d\p{Cyrillic}\d]+\w*)';
$patterns['long_url'] = '>(([[:alnum:]]+:\/\/)|www\.)?([^[:space:]]{12,22})([^[:space:]]*)([^[:space:]]{12,22})([[:alnum:]#?\/&=])<';

if ($type == 'text') {
Expand Down

0 comments on commit db54815

Please sign in to comment.