diff --git a/src/AppBundle/Extractor/Twitter.php b/src/AppBundle/Extractor/Twitter.php index b3e1cdbd..5476f300 100644 --- a/src/AppBundle/Extractor/Twitter.php +++ b/src/AppBundle/Extractor/Twitter.php @@ -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; diff --git a/tests/AppBundle/Extractor/TwitterTest.php b/tests/AppBundle/Extractor/TwitterTest.php index d9573b04..a4a1a027 100644 --- a/tests/AppBundle/Extractor/TwitterTest.php +++ b/tests/AppBundle/Extractor/TwitterTest.php @@ -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],