son Posted February 22, 2011 Share Posted February 22, 2011 I just validated some web pages and saw the following error:character "&" is the first character of a delimiter but occurred as dataDo I really need to replace & with &? What if user who will be using the character using this also on website? Do I have to worry about this?Thanks,Son Link to comment Share on other sites More sharing options...
Ingolme Posted February 22, 2011 Share Posted February 22, 2011 & is the correct way. If you have user input on your site, it's your business to make sure that the text gets translated to proper HTML. With htmlspecialchars(), for example, if your user input is processed by PHP. Link to comment Share on other sites More sharing options...
son Posted February 23, 2011 Author Share Posted February 23, 2011 & is the correct way. If you have user input on your site, it's your business to make sure that the text gets translated to proper HTML. With htmlspecialchars(), for example, if your user input is processed by PHP.Thanks Ingolme. I suppose this applies to any html element, including meta and title tags? Also, do normal CMS systems that are on the market do the same you think? Just wonder how commercial software might deal with this (I am always keen to learn things in proper way if you know what I mean)...Son Link to comment Share on other sites More sharing options...
Fmdpa Posted February 23, 2011 Share Posted February 23, 2011 Yup, this is the proper way to do it for all elements. Most CMS systems probably use a function to encode the characters in displayed data: maybe PHP's htmlspecialchars(), as Ingolme mentioned. Link to comment Share on other sites More sharing options...
son Posted February 23, 2011 Author Share Posted February 23, 2011 Yup, this is the proper way to do it for all elements. Most CMS systems probably use a function to encode the characters in displayed data: maybe PHP's htmlspecialchars(), as Ingolme mentioned.Cheers...Son Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.