22, November 2008

(The user thought that is) Another bug fix - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: (The user thought that is) Another bug fix
« previous next »
Pages: [1] Print

Author Topic: (The user thought that is) Another bug fix  (Read 1158 times)
Atari ST fan
*
Posts: 7
54 credits
Members referred : 0


« on: Oct 22, 2006, 09:15:32 PM »

OK, found another potential bug/undocumented feature.

In the function create_form_field, change

Code:
if (isset($_REQUEST[$formelement])) {
$form_field .= $_REQUEST[$formelement];
}

to

Code:
if (isset($_REQUEST[$formelement])) {
$form_field .= htmlspecialchars($_REQUEST[$formelement], ENT_QUOTES);
}
« Last Edit: Oct 22, 2006, 11:58:14 PM by olaf »
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


Re: Another bug fix
« Reply #1 on: Oct 22, 2006, 11:56:04 PM »

OK, found another potential bug/undocumented feature.

In the function create_form_field, change

Code:
if (isset($_REQUEST[$formelement])) {
$form_field .= $_REQUEST[$formelement];
}

to

Code:
if (isset($_REQUEST[$formelement])) {
$form_field .= htmlspecialchars($_REQUEST[$formelement], ENT_QUOTES);
}

OK, and why do you think that this is a bug? it works fine without "htmlspecialchars"

a bug is about somthing that doesn't work right, you are accepting somthing different, thats called suggesting an approvement Wink


Last blog : Just a better Internet portal provided by Google
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Oct 22, 2006, 11:57:32 PM »

and at the end the test is not OK, better is

if (!empty($_REQUEST['var'])) {...

hehe


Last blog : Just a better Internet portal provided by Google
Atari ST fan
*
Posts: 7
54 credits
Members referred : 0


« Reply #3 on: Oct 23, 2006, 10:38:02 PM »

haha, you're the one that used that test in the first place.

having htmlspecialchars just makes sense though. If the person uses a quote or something else, the new page WILL break, and leave a bad impression. Best to make it a little more foolproof.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6440
39464 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: Oct 23, 2006, 10:44:10 PM »

haha, you're the one that used that test in the first place.

having htmlspecialchars just makes sense though. If the person uses a quote or something else, the new page WILL break, and leave a bad impression. Best to make it a little more foolproof.
Of course your suggestion is not bad but don't tell people that this is a bug while it's based on you personal opinion.
At the end this small details are up to the user, believe me if I use this class for a wide public I use more validation than only some basic html function. Check this class for real validation: http://www.finalwebsites.com/snippets.php?id=15 Visit through proxy


Last blog : Just a better Internet portal provided by Google
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4515
Tags : html Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Access_user Class (Moderator: Olaf)
Topic: (The user thought that is) Another bug fix
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Nov 22, 2008, 02:58:21 PM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 37.736
Total Topics: 7.650
Total Members: 4.396
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: thomas09

36 Guests, 4 Users online :

11 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.