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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.