WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 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)

25140.patch (596 bytes) - added by nofearinc 7 years ago.
25140-video.patch (598 bytes) - added by nofearinc 7 years ago.

Download all attachments as: .zip

Change History (13)

@nofearinc
7 years ago

#1 @nofearinc
7 years ago

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.

#2 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 3.7
  • Version changed from trunk to 3.6

#3 @nofearinc
7 years ago

Just found out the same happens for videos so attaching a video shortcode patch as well.

#4 @SergeyBiryukov
7 years ago

  • Keywords commit added

#5 follow-up: @bhengh
7 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: @nofearinc
7 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 @bhengh
7 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.

Last edited 7 years ago by bhengh (previous) (diff)

#8 follow-up: @nofearinc
7 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: @bhengh
7 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.

#10 in reply to: ↑ 9 @SergeyBiryukov
7 years ago

Replying to bhengh:

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.

Confirmed.

#11 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 25128:

Ignore case differences when checking file extension in wp_audio_shortcode() and wp_video_shortcode(). props nofearinc, bhengh. fixes #25140.

Note: See TracTickets for help on using tickets.