Make WordPress Core

Opened 7 years ago

Closed 6 years ago

#46718 closed defect (bug) (invalid)

Loading from source in WP_Widget_Media_Video

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

Description

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

Attachments (2)

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

Download all attachments as: .zip

Change History (12)

@spacedmonkey
7 years ago

#1 @spacedmonkey
7 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
7 years ago

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

#3 @SergeyBiryukov
7 years ago

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

@audrasjb
7 years ago

Remove unnecessary check for $src

#4 @audrasjb
7 years ago

  • Milestone Awaiting Review5.4
  • Owner set to audrasjb
  • Status newaccepted

#5 @audrasjb
7 years ago

  • Keywords commit added

#6 @desrosj
6 years ago

  • Owner changed from audrasjb to desrosj
  • Status acceptedassigned

#7 @desrosj
6 years ago

  • Resolutionfixed
  • Status assignedclosed

In 47307:

Widgets: Remove unnecessary redundant conditional.

Props spacedmonkey.
Fixes #46718.

#8 @desrosj
6 years ago

  • Keywords commit removed
  • Resolution fixed
  • Status closedreopened

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
6 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
6 years ago

  • Milestone 5.4
  • Resolutioninvalid
  • Status reopenedclosed
Note: See TracTickets for help on using tickets.