wp-cli / doctor-command

Diagnose problems within WordPress by running a series of checks for symptoms
MIT License
146 stars 22 forks source link

"Detect a .png file with PHP code" test fails intermittently #129

Open danielbachhuber opened 7 years ago

danielbachhuber commented 7 years ago

image

image

From #120

danielbachhuber commented 7 years ago

@wp-cli/committers Any hypotheses on why this happens?

schlessera commented 7 years ago

Some sources state that mime_content_type is actually deprecated, and we should try to use http://php.net/manual/en/function.finfo-file.php instead.

$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($finfo, $filename);
finfo_close($finfo);