Python Forum
why is user = form.getfirst("user", "").upper() safe?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
why is user = form.getfirst("user", "").upper() safe?
#1
Hello,

https://docs.python.org/3.5/library/cgi....-interface

import cgi
form = cgi.FieldStorage()
user = form.getfirst("user", "").upper()    # This way it's safe.
...
Why does converting to the cgi form data to upper case make it "safe"?
Reply


Messages In This Thread
why is user = form.getfirst("user", "").upper() safe? - by shanepy - Nov-22-2018, 08:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Regex to catch what user has put in text box robertkwild 2 76 1 hour ago
Last Post: Gribouillis
  Warn user of validation error before they click submit robertkwild 0 82 Jun-07-2024, 08:17 PM
Last Post: robertkwild
  How to Randomly Print a Quote From a Text File When User Types a Command on Main Menu BillKochman 13 1,397 Apr-24-2024, 05:47 AM
Last Post: Bronjer
  run SQL without user intervention python dawid294 0 279 Jan-19-2024, 01:11 PM
Last Post: dawid294
  When is it safe to compare (==) two floats? Radical 4 881 Nov-12-2023, 11:53 AM
Last Post: PyDan
  WHILE LOOP NOT RETURNING USER INPUT AFTER ZerroDivisionError! HELP! ayodele_martins1 7 1,262 Oct-01-2023, 07:36 PM
Last Post: ayodele_martins1
  Help on the User Interface Afia 1 621 Jul-21-2023, 07:22 PM
Last Post: snippsat
  restrict user input to numerical values MCL169 2 1,040 Apr-08-2023, 05:40 PM
Last Post: MCL169
  Replace with upper(string) WJSwan 7 1,720 Feb-10-2023, 10:28 AM
Last Post: WJSwan
  user input values into list of lists tauros73 3 1,202 Dec-29-2022, 05:54 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020