Skip to content

Commit

Permalink
fix: twitter X domain
Browse files Browse the repository at this point in the history
  • Loading branch information
chojnicki committed Oct 11, 2024
1 parent 9a036d5 commit 64e7663
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"ext-json": "*"
},
"require-dev": {
"orchestra/testbench": "3.*||4.*||5.*",
"orchestra/testbench": "3.*||4.*||5.*||6.*",
"phpunit/phpunit": "^8.5.12"
},
"autoload": {
Expand Down
5 changes: 4 additions & 1 deletion src/VideoPlatformsParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,10 @@ public function detectURL($url)
'id' => $params_url['v']
];
}
} else if (strpos($parsed_url['host'], 'twitter.com') !== false) {
} elseif (
strpos($parsed_url['host'], 'twitter.com') !== false ||
strpos($parsed_url['host'], 'x.com') !== false
) {
if (empty($parsed_url['path'])) return false;
$path = explode('/', $parsed_url['path']);
if (!is_numeric(end($path))) return false;
Expand Down

0 comments on commit 64e7663

Please sign in to comment.