Skip to content

Commit

Permalink
Merge pull request #230 from j0k3r/fix/twitter
Browse files Browse the repository at this point in the history
Fix Twitter ID length
  • Loading branch information
j0k3r authored Jun 11, 2019
2 parents 6f99cb5 + e11c1ca commit 5e087f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AppBundle/Extractor/Twitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function match($url)
}

// find tweet id
preg_match('/([0-9]{18})/', $path, $matches);
preg_match('/([0-9]{18,})/', $path, $matches);

if (!\in_array($host, ['mobile.twitter.com', 'twitter.com'], true) || !isset($matches[1])) {
return false;
Expand Down
1 change: 1 addition & 0 deletions tests/AppBundle/Extractor/TwitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function dataMatch()
['https://twitter.com/DoerteDev/statuses/50652222386027724', false],
['https://twitter.com/DoerteDev/statuses/506522223860277248', true],
['http://twitter.com/statuses/506522223860277248', true],
['https://twitter.com/iBSparkes/status/1138294142394437632', true],
['http://twitter.com/_youhadonejob/status/522835690665807872/photo/1', true],
['https://mobile.twitter.com/kcimc/status/638877262092337152/photo/1', true],
['http://user@:80', false],
Expand Down

0 comments on commit 5e087f6

Please sign in to comment.