Hello,
Here is the URL i wanted to embed in my website :
http://www.dailymotion.com/video/xggkum_l-agriculture-familiale-peut-ell...
Here is the regex currently used by the module to get the id :
preg_match('/^https?:\/\/(www\.)?dailymotion.com\/video\/(?[a-z0-9]{7})(_([0-9a-zA-Z\-_])*)?$/', $input, $matches);
I found 2 distinct issues in the regex :
- The id does not contain 7 characters but only 6. I checked on many others dailymotion URL and the id was always composed of 6 characters, why does the regex provide 7 ?
- The regex does not allow specific characters such as '#' or '.' I think we can allow it at the end of the url because we only get the id from this regex and don't get the whole URL. Am I missing something ?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | video_embed_dailymotion-3003014-1.patch | 737 bytes | quentin massez |
Comments
Comment #2
quentin massez commentedHere is the patch that fixed my issue.
I modified the regex to allow id to be composed of 6 or 7 characters (the initial 7 was maybe for a reason so i kept it) and I allowed special characters at the end (we don't care because only get the id)
Comment #3
anfor commentedThis issue look like a duplicate of this other one : https://www.drupal.org/project/video_embed_dailymotion/issues/2900403#co...
Mostly because the other issue solves two birds with one stone .
Comment #4
flocondetoileClosed as duplicate of #2900403: Allow short URLs and embed URLs which is now fixed.