// Formats we recognize magic numbers for
'djvu', 'ogx', 'ogg', 'ogv', 'oga', 'spx', 'opus',
'mid', 'pdf', 'wmf', 'xcf', 'webm', 'mkv', 'mka',
// Formats we recognize magic numbers for
'djvu', 'ogx', 'ogg', 'ogv', 'oga', 'spx', 'opus',
'mid', 'pdf', 'wmf', 'xcf', 'webm', 'mkv', 'mka',
+ 'ID3' => 'audio/mpeg',
+ "\xff\xfb" => 'audio/mpeg', // MPEG-1 layer 3
+ "\xff\xf3" => 'audio/mpeg', // MPEG-2 layer 3 (lower sample rates)
+ "\xff\xe3" => 'audio/mpeg', // MPEG-2.5 layer 3 (very low sample rates)
( strpos( $head, "<\x00?\x00 " ) !== false ) ||
( strpos( $head, "<\x00?\x00\n" ) !== false ) ||
( strpos( $head, "<\x00?\x00\t" ) !== false ) ||
( strpos( $head, "<\x00?\x00 " ) !== false ) ||
( strpos( $head, "<\x00?\x00\n" ) !== false ) ||
( strpos( $head, "<\x00?\x00\t" ) !== false ) ||
$this->logger->info( __METHOD__ . ": recognized $file as application/x-php\n" );
return 'application/x-php';
}
$this->logger->info( __METHOD__ . ": recognized $file as application/x-php\n" );
return 'application/x-php';
}
// Special code for ogg - detect if it's video (theora),
// else label it as sound.
if ( $mime == 'application/ogg' && file_exists( $path ) ) {
// Special code for ogg - detect if it's video (theora),
// else label it as sound.
if ( $mime == 'application/ogg' && file_exists( $path ) ) {
// Read a chunk of the file
$f = fopen( $path, "rt" );
if ( !$f ) {
// Read a chunk of the file
$f = fopen( $path, "rt" );
if ( !$f ) {
/**
* Get the MIME types that various versions of Internet Explorer would
* detect from a chunk of the content.
/**
* Get the MIME types that various versions of Internet Explorer would
* detect from a chunk of the content.