Skip to content

Apache shows PHP code if .php in URL is not lowercase #973

Description

@sam9191

If you enter a URL in browser pointing to a PHP file and .php at the end is not all lowercase (e.g. .phP, .pHp, .PHP, like example.com/index.PHP), Apache shows content of the PHP file.
This is because of this config in /etc/apache2/conf-enabled/docker-php.conf:

<FilesMatch \.php$>
	SetHandler application/x-httpd-php
</FilesMatch>

To fix it, FilesMatch's regexp should be case-insensitive:

<FilesMatch \.(?i:php)$>
	SetHandler application/x-httpd-php
</FilesMatch>

I can make a pull request but should the change be made in this file?

echo '<FilesMatch \.php$>'; \

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions