Jump to content

multiple periods in file names


clbassett03

Recommended Posts

So, when the PHP scripting engine, for example, is parsing a filename, does it treat everything after the last period in the filename as the extension?  I just wanted to make sure it wasn't the other way around, where it would treat everything after the first period it finds, as the file extension.  Again, I'm running on a Linux web server.

Link to comment
Share on other sites

PHP doesn't care what the file extension is, it just parses the files content. Your web server software (apache, nginx, iis, etc) is what would (potentially) look at the extension to determine whether the file is a PHP file or not. How multiple extensions are handled will depend on what server software you are using, as well as how it is configured. For example, under some apache configs, somefile.php.jpg would still be recognized as a php file, which can lead to security issues.

 

In general however, so long as whatever you add between the dots doesn't match a common extension that required special processing (ex: php, pl, cgi, etc) then it will likely be ignored.

Edited by kicken
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.