Bug 39485 - Nested file extensions, If file names include .php, the file will be run as x-httpd-php even if the true file extension is other (ex: .txt)
Summary: Nested file extensions, If file names include .php, the file will be run as x...
Status: RESOLVED DUPLICATE of bug 29090
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: Core (show other bugs)
Version: 2.5-HEAD
Hardware: Other Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL: http://liboss.westlib.asu.edu/files/b...
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-04 18:47 UTC by Webhead
Modified: 2006-05-07 17:20 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Webhead 2006-05-04 18:47:53 UTC
In Apache 2, php files with nested extensions such as .php.phps.txt or
.phps.php.txt will run as a x-httpd-php. All other extensions are ignored even
if the true file extension is .txt or .phps or even .pl. No matter where it's
placed, if the .php is found in the file name, it is run as x-httpd-php.

I tried moving the "AddType application/x-httpd-php .php" to the bottom of the
list just for kicks, but it made no difference.
Comment 1 Ruediger Pluem 2006-05-04 20:50:09 UTC
Have you checked if this happens also with php files that you name
somename.tst.txt and adding AddType application/x-httpd-php .tst to your
configuration? No fingerpointing, but in most cases these kind of reports turn
out to be php bugs.
Comment 2 William A. Rowe Jr. 2006-05-04 21:21:57 UTC
File name components have always been ordered (1st to last) with the last
one replacing the mime control and filter control of the previous segment.

99% certain you are either setting AddHandler conditionally on file-type,
which is problematic unless you also set AddHandler conditionally on every
stock file type (e.g. .txt) replacing the original.

Secondly, you can change the handler by the AddType application/x-httpd-php .php
you mentioned which is good - if that's your only override.

Please review and ensure you have AddType text/plain .txt to override the
AddType application/x-httpd-php metadata!

Make sure your httpd.conf file resolves mime.types

Bill
Comment 3 Nick Kew 2006-05-08 00:20:56 UTC

*** This bug has been marked as a duplicate of 29090 ***