Language: PHP
Label: vulnerable
CWE: CWE-77 \u2014 Improper Neutralization of Special Elements used in a Command ('Command Injection')
The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component.

Code:
	public function coverMake($cachePath,$path,$coverName,$size){
		if(IO::fileNameExist($cachePath,$coverName)){return 'exists;';}
		if(!is_dir(TEMP_FILES)){mk_dir(TEMP_FILES);}
		
		$info = IO::info($path);$ext = $info['ext'];
		$thumbFile = TEMP_FILES . $coverName;		
		$localFile = $this->localFile($path);
		$movie = '3gp,avi,mp4,m4v,mov,mpg,mpeg,mpe,mts,m2ts,wmv,ogv,webm,vob,flv,f4v,mkv,rmvb,rm';
		$isVideo = in_array($ext,explode(',',$movie));
		// 过短的视频封面图,不指定时间;
		$videoThumbTime = true;
		if( $isVideo && is_array($info['fileInfoMore']) && 
			isset($info['fileInfoMore']['playtime']) &&
			floatval($info['fileInfoMore']['playtime']) <= 3 ){
			$videoThumbTime = false;
		}
		if($isVideo){
			// 不是本地文件; 切片后获取:mp4,mov,mpg,webm,f4v,ogv,avi,mkv,wmv;(部分失败)
			if(!$localFile){
				$localTemp = $thumbFile.'.'.$ext;
				$localFile = $localTemp;
				file_put_contents($localTemp,IO::fileSubstr($path,0,1024*600));
			}
			$this->thumbVideo($localFile,$thumbFile,$videoThumbTime);
		} else {
			if(!$localFile){$localFile = $this->pluginLocalFile($path);}
			if($ext == 'ttf'){
				$this->thumbFont($localFile,$thumbFile,$size);
			}else{
				$this->thumbImage($localFile,$thumbFile,$size,$ext);
			}
		}
		if($localTemp){@unlink($localTemp);}
		if(@file_exists($thumbFile)){
			Cache::remove($coverName);
			return IO::move($thumbFile,$cachePath);
		}
		Cache::set($coverName,'no',600);
		del_file($thumbFile);
		return 'convert error! localFile='.get_path_this($localFile);
	}