Advertisement
Guest User

Untitled

a guest
Oct 25th, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. def isSafe( fileName ):
  2.    #cgi path # sisennä: 3 välilyöntiä
  3.    exeFolder, scriptName = os.path.split(os.path.abspath(__file__))
  4.    if "../" in html_page:
  5.       print "Error: You cannot put ../ to the file path." # sisennä: 6 välilyöntiä
  6.       return False
  7.    if len( fileName ) > 40:
  8.       print "Error: Too long file name."
  9.       return False
  10.    if scriptName in fileName:
  11.       print "Error: Cannot have script name in this parameter."
  12.       return False
  13.    return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement