Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Re: DOCTYPES, Validating, Empty Tags and &s.  (Read 5537 times)

0 Members and 1 Guest are viewing this topic.

Titooy

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
Re: DOCTYPES, Validating, Empty Tags and &s.
« on: December 30, 2004, 11:50:33 am »

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
« Last Edit: February 18, 2005, 08:40:35 am by GauGau »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #1 on: December 30, 2004, 12:02:16 pm »

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.
Logged

Titooy

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #2 on: December 30, 2004, 12:15:51 pm »

 ??? 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
Logged

Titooy

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #3 on: December 30, 2004, 12:27:19 pm »

::) Now it doesn't validate anymore.

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

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #4 on: December 30, 2004, 12:30:28 pm »

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.
Logged

Titooy

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #5 on: December 30, 2004, 12:35:33 pm »

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...
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #6 on: December 30, 2004, 12:43:47 pm »

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.
Logged
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

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #7 on: December 30, 2004, 12:54:57 pm »

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.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #8 on: December 30, 2004, 06:52:26 pm »

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

Titooy

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
Re: DOCTYPES, Validating, Empty Tags and &s.
« Reply #9 on: December 31, 2004, 11:24:43 am »

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

FIND
Code: [Select]
$HTML_SUBST = array('"' => '&quot;', '<' => '&lt;', '>' => '&gt;');
REPLACE with
Code: [Select]
$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.
Logged

Casper

  • VIP
  • Coppermine addict
  • ***
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 5231
Re: DOCTYPES, Validating, Empty Tags and &amp;s.
« Reply #10 on: December 31, 2004, 12:14:20 pm »

@ Titooy, thanks, committing to dev version.
Logged
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

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: DOCTYPES, Validating, Empty Tags and &amp;s.
« Reply #11 on: February 18, 2005, 08:40:22 am »

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.picture-parade.co.uk%2Fdevel%2F;verbose=1 validates, so I guess it's safe to mark this thread as "fixed".

Joachim
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 20 queries.