SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot Tikila's Avatar
    Join Date
    Jun 2007
    Location
    Toronto
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess and image.gif as php-confusion

    Can anyone explain to me what is the significance of this htaccess code
    #Makes image.gif, index.html, index.cgi act as php
    ForceType application/x-httpd-php

    Why would one want to have an image.gif act as php?
    Is it not the same thing we protect against using getimagesize and other measures so images are not uploaded with php code embeded in them.?

    Thank you for having a look at and sharing me your understanding of it!

  2. #2
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure what benefit there is to the htaccess code you posted, but getimagesize does not definitively prove a valid image. It is possible to embed PHP in the colour palette or some such and still have a valid GIF file too.

  3. #3
    SitePoint Zealot Tikila's Avatar
    Join Date
    Jun 2007
    Location
    Toronto
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cranial-bore View Post
    I'm not sure what benefit there is to the htaccess code you posted, but getimagesize does not definitively prove a valid image. It is possible to embed PHP in the colour palette or some such and still have a valid GIF file too.
    I found that code somewhere in an Apache documentation being possible to include in an htaccess file,I am wondering of its benefit,too.
    apparently,it makes any file be a certain filetype regardless of name or extension


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •