File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ public function sortByColumn($arr_items)
209209
210210 public function error ($ error_type , $ variables = [])
211211 {
212- return $ this ->helper ->error ($ error_type , $ variables );
212+ throw new \ Exception ( $ this ->helper ->error ($ error_type , $ variables) );
213213 }
214214
215215 // Upload section
@@ -250,8 +250,15 @@ private function uploadValidator($file)
250250 return $ this ->error ('file-exist ' );
251251 }
252252
253+ $ mimetype = $ file ->getMimeType ();
254+
255+ $ excutable = ['text/x-php ' ];
256+
257+ if (in_array ($ mimetype , $ excutable )) {
258+ throw new \Exception ('Invalid file detected ' );
259+ }
260+
253261 if (config ('lfm.should_validate_mime ' , false )) {
254- $ mimetype = $ file ->getMimeType ();
255262 if (false === in_array ($ mimetype , $ this ->helper ->availableMimeTypes ())) {
256263 return $ this ->error ('mime ' ) . $ mimetype ;
257264 }
You can’t perform that action at this time.
0 commit comments