Re: DOCTYPES, Validating, Empty Tags and &s. Re: DOCTYPES, Validating, Empty Tags and &s.
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Re: DOCTYPES, Validating, Empty Tags and &s.

Started by Titooy, December 30, 2004, 11:50:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Titooy

I should have posted this as an answer to http://forum.coppermine-gallery.net/index.php?topic=9485.0 but since I can't post there, here is my remark:

In 1.4a, when there's a "&" in a text field (title, description, alt), the page doesn't validate anymore. See http://validator.w3.org/check?uri=http%3A%2F%2Fwww.picture-parade.co.uk%2Fdevel%2F;verbose=1

Tranz

I got This Page Is Valid XHTML 1.0 Transitional!

The page you presented for validation contains 'Jack & Doris', right?

edit: Strange... I got a different result when I clicked the validation button on the page itself, instead of the link you posted.

Titooy

 ??? How strange ! It didn't validate 20 minutes ago...

I don't know what changed within that time...

edit: If you check the css, it says the xml doesn't validate
http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.picture-parade.co.uk%2Fdevel%2F

Titooy

::) Now it doesn't validate anymore.

I attached the "not validated" page so you can check it even if it validates when you try.

Tranz

There seems to be a difference based on if the results are verbose or not. The link in your post was for the verbose result, which was  valid. The one on your website was not valid, and it showed the & message.

Titooy

Just to notice it's not my site. It's Casper's demo site... the only 1.4 I know that's on-line...

btw, the file I attached is the verbose version...

Casper

Yes, it's my test site, and the validation error in the css is caused by the '&' in the album name.

But this is a test site, often running in themes not yet converted to valid, and the page you saw was not showing the w3c validation links, and not claiming to be such.

This does show that no matter how good we get the code, the end user can destroy the validation in one go with a bad name used to describe something.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Titooy

I think it shouldn't be hard to change "&" into "&" when the page is set. I'm not an expert in php but I think even me could do the needed changes... If no expert does it, I'm gonna look into it later today. Since a "&" in a title is not exceptional, I think it should be corrected in the final release.

Tranz

If you can do it, that will be great since we already have a lot to do and every bit helps. Thanks.

Titooy

OPEN <coppermine>/include/init.inc.php

FIND$HTML_SUBST = array('"' => '&quot;', '<' => '&lt;', '>' => '&gt;');

REPLACE with$HTML_SUBST = array('&' => '&amp;', '"' => '&quot;', '<' => '&lt;', '>' => '&gt;');


It doesn't do it for the data already in the database but it'll work for the new ones.

Casper

@ Titooy, thanks, committing to dev version.
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

Joachim Müller