Can't download .php file


(Carlo Kok) #1

We seem to have gotten an extension with a .php extension (via email, allowed extensions didn’t contain php). And while it doesn’t seem to execute it (thankfully), it returns a 404 instead of the file content. What would be the best solution for this?


(Jay Pfaffman) #2

Edit the post to not link to it and it’ll get deleted automatically.


(Carlo Kok) #3

Right… That doesn’t give me the emaled-in file though.


(Jay Pfaffman) #4

Oh. Since you had PHP files denied I assumed that you didn’t want it.

If you want to solve the problem once, you can

cd /var/discourse
find shared -name "*php"

What happens if you allow uploaded PHP files? Without looking, I’m guessing that there’s something in the Nginx config that denies php files. You can look in the templates (in discourse_docker) for what that is.