/mnt/data/shnoulle/nginx/www/master/framework/utils/CFileHelper.php(282)
270 * PHP extension is available. This parameter has been available since version 1.1.3. 271 * @param boolean $checkExtension whether to check the file extension in case the MIME type cannot be determined 272 * based on finfo and mime_content_type. Defaults to true. This parameter has been available since version 1.1.4. 273 * @return string the MIME type. Null is returned if the MIME type cannot be determined. 274 */ 275 public static function getMimeType($file,$magicFile=null,$checkExtension=true) 276 { 277 if(function_exists('finfo_open')) 278 { 279 $options=defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; 280 $info=$magicFile===null ? finfo_open($options) : finfo_open($options,$magicFile); 281 282 if($info && ($result=finfo_file($info,$file))!==false) 283 return $result; 284 } 285 286 if(function_exists('mime_content_type') && ($result=mime_content_type($file))!==false) 287 return $result; 288 289 return $checkExtension ? self::getMimeTypeByExtension($file) : null; 290 } 291 292 /** 293 * Determines the MIME type based on the extension name of the specified file. 294 * This method will use a local map between extension name and MIME type.
#0 |
+
–
/mnt/data/shnoulle/nginx/www/master/framework/utils/CFileHelper.php(282): finfo_file(resource, "/tmp/phpzmYYCX") 277 if(function_exists('finfo_open')) 278 { 279 $options=defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; 280 $info=$magicFile===null ? finfo_open($options) : finfo_open($options,$magicFile); 281 282 if($info && ($result=finfo_file($info,$file))!==false) 283 return $result; 284 } 285 286 if(function_exists('mime_content_type') && ($result=mime_content_type($file))!==false) 287 return $result; |
#1 |
+
–
/mnt/data/shnoulle/nginx/www/master/application/core/LSFileHelper.php(71): CFileHelper::getMimeType("/tmp/phpzmYYCX", "/usr/share/misc/magic.mgc", true) 66 return $mimeType; 67 } 68 if(empty($magicFile) && Yii::app()->getConfig('magic_database')) { 69 $magicFile = Yii::app()->getConfig('magic_database'); 70 } 71 return parent::getMimeType($file,$magicFile,$checkExtension); 72 } 73 } |
#2 |
+
–
/mnt/data/shnoulle/nginx/www/master/application/core/LSFileHelper.php(43): LSFileHelper::getMimeType("/tmp/phpzmYYCX") 38 $mimeTypes=require(Yii::getPathOfAlias('system.utils.fileExtensions').'.php'); 39 } 40 elseif($magicFile!==null && !isset($customMimeTypes[$magicFile])) { 41 $customMimeTypes[$magicFile]=require($magicFile); 42 } 43 $mime = self::getMimeType($file); 44 if($mime !== null) { 45 $mime=strtolower($mime); 46 if($magicFile===null && isset($mimeTypes[$mime])) { 47 return $mimeTypes[$mime]; 48 } elseif($magicFile!==null && isset($customMimeTypes[$magicFile][$mime])) { |
#3 |
+
–
/mnt/data/shnoulle/nginx/www/master/application/controllers/UploaderController.php(180): LSFileHelper::getExtensionByMimeType("/tmp/phpzmYYCX", "/mnt/data/shnoulle/nginx/www/master/upload/fileExtensionsBis.php") 175 //header('Content-Type: application/json'); 176 echo ls_json_encode($return); 177 Yii::app()->end(); 178 } 179 /* extension checked : check mimeType */ 180 $extByMimeType = LSFileHelper::getExtensionByMimeType($_FILES['uploadfile']['tmp_name'], null); 181 $disableCheck = false; 182 if(is_null($extByMimeType)) { 183 /* Lack of finfo_open or mime_content_type ? But can be a not found extension too.*/ 184 /* Check if can find mime type of favicon.ico , without extension */ 185 /* Use CFileHelper because sure it work with included */ |
#4 |
+
–
/mnt/data/shnoulle/nginx/www/master/framework/web/CWebApplication.php(282): UploaderController->run("index") 277 { 278 list($controller,$actionID)=$ca; 279 $oldController=$this->_controller; 280 $this->_controller=$controller; 281 $controller->init(); 282 $controller->run($actionID); 283 $this->_controller=$oldController; 284 } 285 else 286 throw new CHttpException(404,Yii::t('yii','Unable to resolve the request "{route}".', 287 array('{route}'=>$route===''?$this->defaultController:$route))); |
#5 |
+
–
/mnt/data/shnoulle/nginx/www/master/framework/web/CWebApplication.php(141): CWebApplication->runController("uploader/index/mode/upload/sid/161396/preview/0/fieldname/161396...") 136 foreach(array_splice($this->catchAllRequest,1) as $name=>$value) 137 $_GET[$name]=$value; 138 } 139 else 140 $route=$this->getUrlManager()->parseUrl($this->getRequest()); 141 $this->runController($route); 142 } 143 144 /** 145 * Registers the core application components. 146 * This method overrides the parent implementation by registering additional core components. |
#6 |
+
–
/mnt/data/shnoulle/nginx/www/master/framework/base/CApplication.php(185): CWebApplication->processRequest() 180 public function run() 181 { 182 if($this->hasEventHandler('onBeginRequest')) 183 $this->onBeginRequest(new CEvent($this)); 184 register_shutdown_function(array($this,'end'),0,false); 185 $this->processRequest(); 186 if($this->hasEventHandler('onEndRequest')) 187 $this->onEndRequest(new CEvent($this)); 188 } 189 190 /** |
#7 |
+
–
/mnt/data/shnoulle/nginx/www/master/index.php(194): CApplication->run() 189 require_once APPPATH . 'core/LSYii_Application' . EXT; 190 191 $config = require_once(APPPATH . 'config/internal' . EXT); 192 193 Yii::$enableIncludePath = false; 194 Yii::createApplication('LSYii_Application', $config)->run(); 195 196 /* End of file index.php */ 197 /* Location: ./index.php */ |