Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#46718 closed defect (bug) (invalid)

Loading from source in WP_Widget_Media_Video

Reported by: spacedmonkey's profile spacedmonkey Owned by: desrosj's profile desrosj
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Widgets Keywords: has-patch
Focuses: Cc:


The video widget allow for src url. However, checks are for attachment that are unnecessary.

Attachments (2)

46718.diff (760 bytes) - added by spacedmonkey 5 years ago.
46718.1.diff (810 bytes) - added by audrasjb 5 years ago.
Remove unnecessary check for $src

Download all attachments as: .zip

Change History (12)

5 years ago

#1 @spacedmonkey
5 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
5 years ago

if ( $src ) seems to be redundant, given the if ( empty( $src ) ) { return; } check above.

#3 @SergeyBiryukov
5 years ago

Introduced in [41759], modified in [41765].

5 years ago

Remove unnecessary check for $src

#4 @audrasjb
5 years ago

  • Milestone changed from Awaiting Review to 5.4
  • Owner set to audrasjb
  • Status changed from new to accepted

#5 @audrasjb
5 years ago

  • Keywords commit added

#6 @desrosj
4 years ago

  • Owner changed from audrasjb to desrosj
  • Status changed from accepted to assigned

#7 @desrosj
4 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 47307:

Widgets: Remove unnecessary redundant conditional.

Props spacedmonkey.
Fixes #46718.

#8 @desrosj
4 years ago

  • Keywords commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

I'm reopening this to revert.

After committing some tests started failing so I dug a bit deeper.

Even though the $attachment check appears redundant, the intention of including it is to ensure the attachment's src is passed through wp_video_shortcode() and the associated filters. The else condition should only be used for videos that are not attachments, and those that do not match the special scenarios (YouTube/Vimeo).

I am going to close this out after reverting, but if this assessment seems incorrect, please let me know!

#9 @desrosj
4 years ago

In 47308:

Widgets: Revert [47307].

Even though the source URL for an attachment is stored in a variable, attachments should still be passed through the wp_video_shortcode() function.

Unprops desrosj, spacedmonkey.
See #46718.

#10 @desrosj
4 years ago

  • Milestone 5.4 deleted
  • Resolution set to invalid
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.