1 | Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/virtual/big-clan.zer-o.eu/phptmp/php49nRaV) is not within the allowed path(s): (/var/www/virtual/big-clan.zer-o.eu/htdocs/:/usr/share/php/) in /var/www/virtual/big-clan.zer-o.eu/htdocs/include/includes/func/ic_mime_type.php on line 12 |
ic_mime_type.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | <?php /* Magic mime file interpreter Copyright (c) 2004 by Phillip Berndt Version 1.0 */ function ic_mime_type ( $file ) { if (! file_exists ( $file )) { return ( 'application/x-object' ); } if (!isset( $mimeData )) { $mimeFile = array ( '0 string PK\003\004 application/x-zip' , '0 string Rar! application/x-rar' , '257 string ustar\0 application/x-tar posix' , '257 string ustar\040\040\0 application/x-tar gnu' , '0 string GIF image/gif' , '0 beshort 0xffd8 image/jpeg' , '0 string \137PNG image/png' , '>30 string Copyright\ 1989-1990\ PKWARE\ Inc. application/x-zip' , '>30 string PKLITE\ Copr. application/x-zip' , ); foreach ( $mimeFile as $mimeLine ) { if ( $mimeLine [0] != '#' && trim( $mimeLine )) { if (preg_match( '/^(\S+?)\s+(\S+?)\s+(\S+)(\s+(.+?))?$/si' , $mimeLine , $regex_mimeDataSet )) { $mimeDataSet [ 'offset' ] = str_replace ( '>' , '' , $regex_mimeDataSet [1]); $indicator = $regex_mimeDataSet [3]; switch ( $regex_mimeDataSet [2]) { case 'string' : $indicator = str_replace ( '\ ' , ' ' , $indicator ); $indicator = str_replace ( '\<' , '<' , $indicator ); $indicator = str_replace ( '\>' , '>' , $indicator ); $indicator = str_replace ( '\r' , "\r" , $indicator ); $indicator = str_replace ( '\n' , "\n" , $indicator ); $indicator = preg_replace( '/\\\\([0-9]{3})/e' , 'chr($1);' , $indicator ); break ; case 'byte' : $indicator = pack( 'c' , @ eval ( 'return ' . $indicator . ';' )); break ; case 'short' : $indicator = pack( 's' , @ eval ( 'return ' . $indicator . ';' )); break ; case 'beshort' : $indicator = pack( 'n' , @ eval ( 'return ' . $indicator . ';' )); break ; case 'leshort' : $indicator = pack( 'v' , @ eval ( 'return ' . $indicator . ';' )); break ; case 'belong' : $indicator = pack( 'N' , @ eval ( 'return ' . $indicator . ';' )); break ; case 'lelong' : $indicator = pack( 'V' , @ eval ( 'return ' . $indicator . ';' )); break ; case 'long' : $indicator = pack( 'l' , @ eval ( 'return ' . $indicator . ';' )); break ; } $mimeDataSet [ 'indicator' ] = $indicator ; $mimeDataSet [ 'mime' ] = str_replace ( "\r" , '' , $regex_mimeDataSet [5]); $mimeData [] = $mimeDataSet ; } } } } $o = fopen ( $file , "r" ); $file_content = fgets ( $o , 4096); fclose( $o ); $retVal = 'application/x-object' ; foreach ( $mimeData as $key => $mimeTest ) { $testStr = substr ( $file_content , $mimeTest [ 'offset' ], strlen ( $mimeTest [ 'indicator' ])); if ( $testStr == $mimeTest [ 'indicator' ]) { $mimeType = $mimeTest [ 'mime' ]; if ( $mimeType == '' ) { while ( $mimeType == '' ) { $mimeType = $mimeData [++ $key ][ 'mime' ]; } } $retVal = $mimeType ; } } return $retVal ; } ?> |
verwendete ilchClan Version: 1.1
betroffene Homepage: externer Link