WordPress.org

Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 14 years ago

#1961 closed defect (bug) (fixed)

Header image generator misreads values, creates invalid and broken XHTML

Reported by: philor Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.6
Component: Template Keywords:
Focuses: Cc:

Description

In templates/default/functions.php:

The kubrick_header_image option is saved with an unescaped ampersand, so it breaks XHTML.

The functions kubrick_upper_color and kubrick_lower_color have a counting problem, so after saving a new set of colors they get, e.g., ee8&lo for 69aee8 and 0b7 for 4180b7. To not abandon people who have saved a set of colors with an unencoded ampersand, they need to not just take a substr starting at the right number, but actually parse the string (at least to the extent of taking the 6 characters after the first and last occurrence of "="), since the lower_color can start at either character 34 or 38.

The kubrick_head function inserts the style hidden from incredibly ancient browsers with SGML comments, so in XHTML as XML it doesn't exist.

Change History (5)

#1 @matt
15 years ago

I would like for you to attempt to use an encoded ampersand in embedded CSS. I didn't have any luck.

#2 @davidhouse
15 years ago

Ideally, it should be in a CDATA block, so unencoded ampersands would be allowed. What's browser support like here?

#3 @philor
15 years ago

Mmm, nice. Easy to do if you know what you're serving, not if you don't. There is a commenting hack that apparently mostly works, except maybe in some older versions of Opera, but

<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
&
/*]]>*/--></style>

is a touch ugly.

And since the colorpicker uses document.writeln(), it's also tag-soup-only. Maybe just hiding the whole thing based on html_type is the sane way out.

#4 @skeltoac
15 years ago

  • Milestone set to 2.0
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [3276]

#5 @(none)
14 years ago

  • Milestone 2.0 deleted

Milestone 2.0 deleted

Note: See TracTickets for help on using tickets.