Make WordPress Core

Opened 14 years ago

Closed 13 years ago

#10182 closed defect (bug) (fixed)

XHTML well-formedness

Reported by: brettz95's profile brettz95 Owned by:
Milestone: 3.0 Priority: low
Severity: minor Version: 2.8
Component: Validation Keywords: reporter-feedback, needs-patch
Focuses: Cc:



Just offering a patch of a few files which break Wordpress under application/xhtml+xml . Not sure if this is the best way to fix them, but it at least did the trick.

Attachments (2)

wpXhtmlIssues.patch (1.6 KB) - added by brettz95 14 years ago.
Patches for application/xhtml+xml well-formedness
template.php.patch (677 bytes) - added by brettz95 13 years ago.
Escape URL for application/xhtml+xml

Download all attachments as: .zip

Change History (14)

14 years ago

Patches for application/xhtml+xml well-formedness

#1 @dd32
14 years ago

  • Keywords needs-patch added
  • Milestone changed from Unassigned to 2.9
  • Version set to 2.8

-1 to the patch. The urlencodes shouldnt be needed there.. Where ever its being outputted should be run through the esc_raw_url() function (Or whatever its called...)

+1 for the <tr> removal tho.

#2 @Denis-de-Bernardy
14 years ago

  • Component changed from General to Validation

#3 @brettz95
14 years ago

  • Cc brettz95 added

How about the moving of </span>? I had to move the 'endif' to avoid a broken span (not sure if you preferred an empty span in an empty td, or just an empty td, but having only an opening tag of course causes problems with well-formedness...)

As far as urlencode, while I didn't know where you wanted it, application/xhtml+xml does break without it, and from the looks of the rewrite.php file at least, there are a number of references which use that data, so I thought it better to nip it in the bud. Sorry I can't offer more help on it (at least now), but if you want to allow application/xhtml+xml (i.e., be well-formed), the patch could at least indicate where the problems may lie.

#4 @brettz95
14 years ago

  • Summary changed from XHTML validation to XHTML well-formedness

#5 @lloydbudd
14 years ago

  • Keywords reporter-feedback added
  • Milestone changed from 2.9 to 3.0
  • Priority changed from normal to low
  • Severity changed from normal to minor

Low priority, we got to get shipping 2.9.

brettz95 thanks for championing this. Can you create separate tickets for each of the 3 issues, so that a disagreement about one doesn't end up in the easy fixes handing around for another 5 months ;-) Thanks again!

#6 @brettz95
13 years ago

Sorry, I see I didn't have email notification on. It seems like the first two items in my patch I supplied have already been applied. So the only issue remaining in this patch is for the urlencoding.

As far as my patch to add urlencode() to comment-template.php, that seems that it should not be applied at all now since I got errors with it (at least since the 2.9 update). Not sure if I just haven't encountered again the place where I originally did need it, or whether subsequent releases fixed the issue.

As far as urlencode() in rewrite.php in the patch, however, I still need to add it. I don't know that this is the best or even a bug-free place for the urlencode() to go, but without it, on my administrative screen for comments, I get a poorly formed page.


#7 @brettz95
13 years ago

Sorry, I guess I did need for the comments administration (but I believe it messes up redirecting when a user makes a comment via the main interface). I guess this is what dd32 was talking about. In any case, without doing anything, I can't read the comments administration page, so it would be great if that could be fixed.

I'd also really recommend you all consider testing with application/xhtml+xml enabled because it can help you spot bugs like these which not only break things for those of us enabling it, but also may identify other problems. Also, with HTML5 coming out, and a more compatible XHTML5 serialization, I think there will be even fewer reasons not to use application/xhtml+xml for browsers that support it. Just a thought...

13 years ago

Escape URL for application/xhtml+xml

#8 @brettz95
13 years ago

Sorry for the "flaming" here, but I realized this wasn't so hard to debug after all based on more carefully considering dd32's advice (though for display, it turns out esc_url() is needed not esc_url_raw())... Here's a patch that works--you can indeed forget about the urlencode()s and the other items mentioned previously in this bug... As of this fix applied to version 2.9 application/xhtml+xml now appears to work again for all of the main admin pages and user pages, if not all pages...Thanks!

#9 @Denis-de-Bernardy
13 years ago

breetz95 -- I've opened a new ticket for that one: #11492. please move further further discussions in it and in new tickets.

#10 @Denis-de-Bernardy
13 years ago

one of the issues in the ticket is fixed in r12494

#11 @brettz95
13 years ago

As far as the issues I have found as far as well-formedness and reported in this ticket, your patch in #11492, Denis, appears to have fixed all of the remaining issues in the ticket (unless there are XHTML well-formedness issues I have not found). Someone fixed the <tr/> and "endif" placement issues addressed in my first patch earlier on (and my urlencode() "fixes" were mistaken and the issue they attempted to resolve were fixed by my later patch and even more thoroughly by your patch).

Yes, there are some XHTML _validation_ issues remaining (not reported in this ticket), but that is less important than well-formedness problems; also validation problems are not mentioned anywhere in this report. So, I think this issue here can be closed (unless you are keeping it open for tracking any future well-formedness issues that may come up).

In case anyone is interested, the following pages address some of the issues in text/html vs. application/xhtml+xml, the first of which is quite current and refers to changes in Firefox which put it more in line with HTML5, which is meant to avoid the few remaining JavaScript differences between true XHTML and HTML, and the rest, which contain useful, though partly outdated information (in decreasing order of present usefulness):


#12 @Denis-de-Bernardy
13 years ago

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

closing as fixed, then. please open new tickets for new issues.

Note: See TracTickets for help on using tickets.