Comments

dave reid’s picture

Title: update.php fails HTML validation » Invalid HTML in update.php
Version: 6.4 » 7.x-dev
Status: Active » Needs review
Issue tags: +Quick fix, +Novice
StatusFileSize
new1.12 KB
mr.baileys’s picture

Issue tags: +Invalid markup
StatusFileSize
new1.05 KB

After applying this patch, the W3C validator still reported an issue with the use of unescaped ampersands in URLs (one instance, which results in a number of errors and warnings).

From Common HTML validation problems (referred to by the W3C validator service):

Ampersands (&'s) in URLs

Another common error occurs when including a URL which contains an ampersand ("&"):

...

This example generates an error for "unknown entity section" because the "&" is assumed to begin an entity reference. Browsers often recover safely from this kind of error, but real problems do occur in some cases. In this example, many browsers correctly convert &copy=3 to ©=3, which may cause the link to fail. Since ⟨ is the HTML entity for the left-pointing angle bracket, some browsers also convert &lang=en to 〈=en. And one old browser even finds the entity §, converting &section=2 to §ion=2.

To avoid problems with both validators and browsers, always use & in place of & when writing URLs in HTML:

...

Note that replacing & with &amp; is only done when writing the URL in HTML, where "&" is a special character (along with "<" and ">"). When writing the same URL in a plain text email message or in the location bar of your browser, you would use "&" and not "&amp;". With HTML, the browser translates "&amp;" to "&" so the Web server would only see "&" and not "&amp;" in the query string of the request.

Made another change to fix the issue described above.

+1 positive review from me on this patch. After applying the W3C validator stops complaining, and the page succesfully passes XHTML 1.0 Strict validation.

Status: Needs review » Needs work

The last submitted patch failed testing.

mr.baileys’s picture

Status: Needs work » Needs review

This patch still applies against HEAD. Re-testing.

Status: Needs review » Needs work

The last submitted patch failed testing.

damien tournoud’s picture

Status: Needs work » Needs review

Test bot glitch.

dave reid’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works fine. I tried running update.php without JavaScript, but it had the same not-working behaviour as before the patch.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

pasqualle’s picture

Version: 7.x-dev » 6.x-dev
Status: Fixed » Patch (to be ported)
mr.baileys’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new1.04 KB

Ported to D6.

dave reid’s picture

Issue tags: +XHTML validation

Adding tag.

pasqualle’s picture

Status: Needs review » Reviewed & tested by the community

The XHTML is valid in the update.php after the patch..

The string concatenation is different than it is used in D6, but as I see it follows the new coding standards.

damien tournoud’s picture

Status: Reviewed & tested by the community » Needs work

The new coding standard only apply from D7 onwards.

pasqualle’s picture

@Damien: Are you sure? I can't find any info about it, and I am almost sure that many module developers follow the new string concatenation standard in their D6 modules..
But I agree that would be nice if the code style would be the same in the whole Drupal 6 core, regardless what the actual coding standard is..

pasqualle’s picture

StatusFileSize
new1.11 KB

string concatenation fix

pasqualle’s picture

Status: Needs work » Needs review
mr.baileys’s picture

Status: Needs review » Reviewed & tested by the community

Agree with Damien, I should have followed D6 coding style. I think the coding standards document should be split into versions, with one coding standards document per major branch much like the module developer's guide has a version for D5 and one for D6. I don't think there currently is a way to see what the coding standards for D6 and D5 are...

Thanks for re-rolling Pasqualle, patch is good to go...

mr.baileys’s picture

Issue tags: -Invalid markup

removing old tag since we're now using 'XHTML validation'.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed to 6.x.

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix, -Novice, -XHTML validation

Automatically closed -- issue fixed for 2 weeks with no activity.