WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#11603 closed enhancement (wontfix)

Ensure that oEmbed returns XHTML valid code

Reported by: hpguru Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.9
Component: Validation Keywords: dev-feedback 2nd-opinion
Focuses: Cc:

Description

Works well but no XHTML valid auto video support. Please make it xhtml valid. :)

Attachments (1)

wpvideo.jpg (175.2 KB) - added by hpguru 4 years ago.
XHTML Validator

Download all attachments as: .zip

Change History (16)

comment:1 follow-up: miqrogroove4 years ago

  • Keywords reporter-feedback added; Video removed

hpguru, your bug report needs to contain a description of the problem. What isn't valid? How can we reproduce the problem on our own blogs?

hpguru4 years ago

XHTML Validator

comment:2 in reply to: ↑ 1 hpguru4 years ago

Replying to miqrogroove:

hpguru, your bug report needs to contain a description of the problem. What isn't valid? How can we reproduce the problem on our own blogs?

I add a screenshot.

comment:3 hpguru4 years ago

"Easier video embeds that allow you to just paste a URL on its own line and have it magically turn it into the proper embed code, with Oembed support for YouTube, Daily Motion, Blip.tv, Flickr, Hulu, Viddler, Qik, Revision3, Scribd, Google Video, Photobucket, PollDaddy, and WordPress.tv (and more in the next release)."

Broken my site XHTML with 7 errors.

comment:4 miqrogroove4 years ago

So that screenshot shows the code you embedded from youtube.com. What would you like WordPress to do differently?

comment:5 Denis-de-Bernardy4 years ago

  • Component changed from General to Validation
  • Keywords reporter-feedback removed
  • Milestone changed from 2.9.1 to 3.0
  • Priority changed from high to normal
  • Type changed from defect (bug) to enhancement

he's complaining that the code returned by YouTube isn't XHTML valid. suggesting wontfix.

@hpguru: please complain to YouTube, and ask them to add a wmode=transparent parameter while they're at it.

comment:6 Denis-de-Bernardy4 years ago

  • Summary changed from New automated video support to Ensure that oEmbed returns XHTML valid code

comment:7 follow-up: miqrogroove4 years ago

suggesting wontfix.

I can imagine the next ticket, "Please block embedded advertising / cookies / videos that have been deleted / what have you."

comment:8 hpguru4 years ago

WordPress has WPvideo plugin that add valid YouTube videos. I think that is possible in WP own oEmbed. But i like how oEmbed work. Looks great that options are xhtml valid in 3.0 WP.

comment:9 in reply to: ↑ 7 hpguru4 years ago

Replying to miqrogroove:

suggesting wontfix.

I can imagine the next ticket, "Please block embedded advertising / cookies / videos that have been deleted / what have you."

No. I think that XHTML valid code is WordPress PROMISE. Wordpress is XHTML VALID. So, i think that oEmbed feature would be a valid to, is what software to use permit. :)

comment:10 hpguru4 years ago

  • Keywords oEmbed added

comment:11 miqrogroove4 years ago

If you want valid XHTML then don't use oEmbed. C'mon. The entire premise of this feature is to allow 3rd-parties to XSS your website. If it's not YouTube causing the problem it will be any of the other whitelisted providers eventually.

comment:12 dd324 years ago

  • Keywords needs-patch added; oEmbed removed

The issue at heart here, Is that your doctype does not allow the usage of <embed> which is required for older non-XHTML compliant browsers.

In an environment where you're using XHTML, you'll probably need to filter out the non-compliant elements, as oEmbed is designed to use the trusted code from the embedder. And its unlikely WordPress is going to mess with the results, because removing embed means removing support for older browsers (No idea which browsers..)

In your case, something like this (untested) will achieve it:

add_filter('oembed_dataparse', '_strip_embed');
function _strip_embed($data) {
    $data = preg_replace('|<embed.+?>.*?</embed>|i', '', $data);
    return $data;
}

comment:13 dd324 years ago

  • Keywords dev-feedback 2nd-opinion added; needs-patch removed

comment:14 Denis-de-Bernardy4 years ago

  • Milestone 3.0 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

looks like everyone is agreeing this ticket should be closed. @hpguru: don't use oembed. (or use dd32's function)

comment:15 sirzooro4 years ago

@hpguru: you can also take a look on Tidy - it should always return valid XHTML.

Note: See TracTickets for help on using tickets.