The finfo function is returning crazy mime types. Look the following code, what is going on?
I recently faced a situation where an uploaded text file was wrongly recognized as "text/x-c++" because it began with the keyword class . It was correctly recognized as "text/plain" with another first word. It was indeed probably related to the browser recognition algorithm, as this also occurred on this website : https://htmlstrip.com/mime-file-type-checker