403Webshell
Server IP : 162.0.217.223  /  Your IP : 216.73.216.150
Web Server : LiteSpeed
System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
User : mypckeys ( 1539)
PHP Version : 8.1.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/mypckeys/backup/msckey.com/wp-content/plugins/webp-express/lib/classes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/mypckeys/backup/msckey.com/wp-content/plugins/webp-express/lib/classes/Mime.php
<?php

namespace WebPExpress;

use \WebPExpress\Config;
use \WebPExpress\Convert;

class Mime
{

    public static function getMimeTypeOfMedia($filename)
    {
        // ensure filename is not empty, as wp_get_image_mime() goes fatal if it is
        if ($filename === '') {
          return 'unknown';
        }

        // First try the Wordpress function if available (it was introduced in 4.7.1)
        if (function_exists('wp_get_image_mime')) {

            // PS: wp_get_image_mime tries exif_imagetype and getimagesize and returns false if no methods are available
            $mimeType = wp_get_image_mime($filename);
            if ($mimeType !== false) {
                return $mimeType;
            }

        }

        // Try mime_content_type
        if (function_exists('mime_content_type')) {
            $mimeType = mime_content_type($filename);
            if ($mimeType !== false) {
                return $mimeType;
            }
        }

        if (function_exists('wp_check_filetype')) { // introduced in 2.0.4
            // Try wordpress method, which simply uses the file extension and a map
            $mimeType = wp_check_filetype($filename)['type'];
            if ($mimeType !== false) {
                return $mimeType;
            }
        }

        // Don't say we didn't try!
        return 'unknown';
    }

    public static function isOneOfTheseImageMimeTypes($filename, $imageMimeTypes)
    {
        $detectedMimeType = self::getMimeTypeOfMedia($filename);
        return in_array($detectedMimeType, $imageMimeTypes);
    }

}

Youez - 2016 - github.com/yon3zu
LinuXploit