mirror of
				https://gitee.com/zoujingli/ThinkAdmin.git
				synced 2025-10-31 12:02:08 +08:00 
			
		
		
		
	修改文件上传配置
This commit is contained in:
		
							parent
							
								
									9adad7e15f
								
							
						
					
					
						commit
						84bd116e8c
					
				| @ -92,11 +92,9 @@ class Config extends Controller | ||||
|         } else { | ||||
|             $post = $this->request->post(); | ||||
|             if (!empty($post['storage']['allow_exts'])) { | ||||
|                 $deny = ['sh', 'asp', 'bat', 'cmd', 'exe', 'php']; | ||||
|                 $exts = array_unique(str2arr(strtolower($post['storage']['allow_exts']))); | ||||
|                 foreach (['sh', 'asp', 'bat', 'cmd', 'exe', 'php'] as $ext) { | ||||
|                     if (in_array($ext, $exts)) $this->error('禁止上传可执行的文件!'); | ||||
|                 } | ||||
|                 sort($exts); | ||||
|                 if (array_intersect($deny, $exts)) $this->error('禁止上传可执行的文件!'); | ||||
|                 $post['storage']['allow_exts'] = join(',', $exts); | ||||
|             } | ||||
|             foreach ($post as $name => $value) sysconf($name, $value); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user