Opened 11 years ago
Closed 11 years ago
#25140 closed defect (bug) (fixed)
[audio] shortcode not rendering audio types with upper case extensions using src
Reported by: | nofearinc | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 3.7 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Shortcodes | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
As per this report if we try to embed audio file with an uppercase extensions (such as .MP3) it's not displaying the audio player, but the link itself.
Attaching a patch to invoke strtolower
for extension types to avoid this scenario.
Attachments (2)
Change History (13)
#3
@
11 years ago
Just found out the same happens for videos so attaching a video shortcode patch as well.
#5
follow-up:
↓ 6
@
11 years ago
- Cc bhengh added
The patches on lines 874 and 1013 will fix the problem if the file is specified with the "src" parameter. However, if the file is specified using a format specific parameter, such as "mp3", it will still fail. A similar patch needs to happen on lines 882 and 1021.
#6
in reply to:
↑ 5
;
follow-up:
↓ 7
@
11 years ago
Replying to bhengh:
The patches on lines 874 and 1013 will fix the problem if the file is specified with the "src" parameter. However, if the file is specified using a format specific parameter, such as "mp3", it will still fail. A similar patch needs to happen on lines 882 and 1021.
Did you test it yourself? It works for me if I specify a parameter other than src
for the correct format with a MP3 all-caps extension.
#7
in reply to:
↑ 6
@
11 years ago
Replying to nofearinc:
Did you test it yourself? It works for me if I specify a parameter other than
src
for the correct format with a MP3 all-caps extension.
Yes, I just tested it. I'm using WordPress 3.6 with the patch to wp-includes/media.php, line 874. When I put the following shortcode on my page:
[audio src="http://example.com/test_capital.MP3"]
It works now, with the patch. But when I put this shortcode on:
[audio mp3="http://example.com/test_capital.MP3"]
It failed. Then I patched line 882, and the second shortcode started working.
#8
follow-up:
↓ 9
@
11 years ago
I see your point and I think that I could reproduce that on 3.6 stable. I can't reproduce it with latest trunk.
Could you test it with the trunk version?
#9
in reply to:
↑ 8
;
follow-up:
↓ 10
@
11 years ago
Replying to nofearinc:
I see your point and I think that I could reproduce that on 3.6 stable. I can't reproduce it with latest trunk.
Could you test it with the trunk version?
tl;dr: I just tested it, and the trunk acts the same as 3.6 stable.
Details:
I installed the trunk version (3.7 alpha, rev 25104). Neither shortcode worked. Then I patched line 874. The first shortcode (src=) worked, the second shortcode (mp3=) did not. Then I patched line 882, and both shortcodes worked.
On a side note, this doesn't happen when uploading files as the extension is converted to .mp3 when uploaded through the media uploader, so this could be reproduced for external audio files.