403Webshell
Server IP : 192.64.118.117  /  Your IP : 3.144.199.9
Web Server : LiteSpeed
System : Linux premium56.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64
User : thecgapy ( 1160)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/thecgapy/tcrgfinancesuite.com/wp-content/plugins/w3-total-cache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/thecgapy/tcrgfinancesuite.com/wp-content/plugins/w3-total-cache/Util_Mime.php
<?php
namespace W3TC;

class Util_Mime {
	/**
	 * Returns file mime type
	 *
	 * @param string  $file
	 * @return string
	 */
	static public function get_mime_type( $file ) {
		static $cache = array();

		if ( !isset( $cache[$file] ) ) {
			$mime_type = false;

			/**
			 * Try to detect by extension (fast)
			 */
			$mime_types = include W3TC_INC_DIR . '/mime/all.php';

			foreach ( $mime_types as $extension => $type ) {
				if ( preg_match( '~\.(' . $extension . ')$~i', $file ) ) {
					if ( is_array( $type ) )
						$mime_type = array_pop( $type );
					else
						$mime_type = $type;
					break;
				}
			}

			/**
			 * Try to detect using file info function
			 */
			if ( !$mime_type && function_exists( 'finfo_open' ) ) {
				$finfo = @finfo_open( FILEINFO_MIME );

				if ( !$finfo ) {
					$finfo = @finfo_open( FILEINFO_MIME );
				}

				if ( $finfo ) {
					$mime_type = @finfo_file( $finfo, $file );

					if ( $mime_type ) {
						$extra_mime_type_info = strpos( $mime_type, "; " );

						if ( $extra_mime_type_info ) {
							$mime_type = substr( $mime_type, 0, $extra_mime_type_info );
						}

						if ( $mime_type == 'application/octet-stream' ) {
							$mime_type = false;
						}
					}

					@finfo_close( $finfo );
				}
			}

			/**
			 * Try to detect using mime type function
			 */
			if ( !$mime_type && function_exists( 'mime_content_type' ) ) {
				$mime_type = @mime_content_type( $file );
			}

			/**
			 * If detection failed use default mime type
			 */
			if ( !$mime_type ) {
				$mime_type = 'application/octet-stream';
			}

			$cache[$file] = $mime_type;
		}

		return $cache[$file];
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit