What is the best way to verify .swf files and/or normal input text

Discussion in 'PHP' started by Imozeb, Mar 23, 2010.

  1. #1
    I know how to verify that the file type is .swf but is there anyway I can verify the dimensions of the movie or if it contains any malicious code and the like?

    Also is there anyway I can verify normal input text from a text field. I know how to verify that it isn't null, how to strip html tags, and how to use 'mysql_real_escape_string()' but is there any other important processes that I should do to verify input text?


    Thanks!

    ~imozeb :)
     
    Imozeb, Mar 23, 2010 IP
  2. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If nobody knows about how to validate .swf files can someone at least tell me about how to validate imput text?
     
    Imozeb, Mar 24, 2010 IP
  3. pig2cat

    pig2cat Active Member

    Messages:
    299
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Hi,
    For my videohost I use http://mediainfo.sourceforge.net/en
    I run it by doing

    $result = exec('/path/to/mediainfo ' . $your swf file . '');
    find the syntax for finding the video type and let it return that
    this however,
    - does not prevent people from using malicious code(like user redirects) if they use a valid swf file
    - does make sure that the file is not a text file or anything

    and the verification:
    if(! empty($variable))
    or
    if($veriable != NULL)

    strip_tags($variable); //strips html
    addslashes($veriable); //if you want to add it in a database
    also check out the php preg_replace function if you only want A-Z, a-z and 0-9 in your input (this method is pretty solid and foolproof)
     
    pig2cat, Mar 25, 2010 IP
  4. Imozeb

    Imozeb Peon

    Messages:
    666
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks pig2cat.
     
    Imozeb, Mar 25, 2010 IP