Skip to content

Commit

Permalink
fix for parsing when no hash is present
Browse files Browse the repository at this point in the history
  • Loading branch information
jamosmk7 committed Jul 20, 2023
1 parent ded310c commit 0a85ea4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Services/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function viewData(): array
*/
protected function parseUrl(): ?array
{
preg_match('/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})\/([a-z0-9]+)[?]?.*/', $this->url, $match);
preg_match('/(https?:\/\/)?(www\.)?(player\.)?vimeo\.com\/([a-z]*\/)*([0-9]{6,11})\/?([a-z0-9]+)[?]?.*/', $this->url, $match);

if (array_key_exists(5, $match)) {
return [
Expand Down
2 changes: 2 additions & 0 deletions tests/Rules/EmbeddableUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public function test_it_passes_a_validUrl_for_any_service()
'https://miro.com/miroverse/category/workshops/remote-ux-workshops',
'http://www.slideshare.net/haraldf/business-quotes-for-2011',
'https://vimeo.com/148751763',
'https://vimeo.com/148751763/243529c0ef',
'https://vimeo.com/148751763/243529c0ef?share=copy',
'https://youtu.be/dQw4w9WgXcQ',
'https://www.youtube.com/embed/dQw4w9WgXcQ',
];
Expand Down
2 changes: 2 additions & 0 deletions tests/Services/VimeoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ protected function validUrls(): array
{
return [
'https://vimeo.com/148751763',
'https://vimeo.com/148751763/243529c0ef',
'https://vimeo.com/148751763/243529c0ef?share=copy',
];
}
}

0 comments on commit 0a85ea4

Please sign in to comment.