Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently when the video url is like "//youtube.com/embed/AAAAA" then parameters are not added to the embed b/c the embed_url being passed into _mytube_fixembedded() has been changed to http:// due to the parsing in the calling function _mytube_replaceembed() to remedy this I propose we change the following:
...
$embed_url = preg_replace("[^//]", $PROTOCOL, $embed_url);
$embed_urlinfo = parse_url($embed_url );
...
to
...
$parseable_embed_url = preg_replace("[^//]", $PROTOCOL, $embed_url);
$embed_urlinfo = parse_url($parseable_embed_url);
...
Also, the code for youtube-nocookie.com is duplicated from youtbe.com in _mytube_fixembedded(). Instead of duplicating this code I propose we remove the duplicated code and add youtube-nocookie.com as a fall through to youtube.com.
Comment | File | Size | Author |
---|---|---|---|
#5 | mytube-fix_adding_parameters-2423479-4.patch | 3.63 KB | grndlvl |
Comments
Comment #1
grndlvl CreditAttribution: grndlvl commentedI have attached 2 patches to address the issue.
mytube-fix_adding_parameters-2423479-1.patch applies to 7.x-1.x-dev without any other patches.
mytube-fix_adding_parameters-with_firstChar_patch_2421701_1-2423479-1.patch applies with the patch from #2421701: Notice: Use of undefined constant firstChar applied.
Comment #2
grndlvl CreditAttribution: grndlvl commentedWhoops didn't catch that the thumbnail function is plagued by the same issue. Passed in the parseable version of the url for the thumbnail generation.
I have attached 2 patches to address the issue.
mytube-fix_adding_parameters-2423479-2.patch applies to 7.x-1.x-dev without any other patches.
mytube-fix_adding_parameters-with_firstChar_patch_2421701_1-2423479-2.patch applies with the patch from #2421701: Notice: Use of undefined constant firstChar applied.
Comment #3
grndlvl CreditAttribution: grndlvl commentedActually I needed a patch with the firstChar patch @ #2421701: Notice: Use of undefined constant firstChar & the theme patch @ #2082717: Embed code replacement HTML should be generated in a theme() function. So here is that too, but I will hide it so it won't cloud the patches.
Comment #4
grndlvl CreditAttribution: grndlvl commentedwhoops for got the 2nd parameter for strpos().
Comment #5
grndlvl CreditAttribution: grndlvl commentedWelp still missed some other instances and logic was adding two ?? I have now adjusted the logic for even further.
Comment #7
mfbComment #8
grndlvl CreditAttribution: grndlvl at GollyGood Software for Advomatic commented