File tree 1 file changed +9
-2
lines changed
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)
209
209
210
210
public function error ($ error_type , $ variables = [])
211
211
{
212
- return $ this ->helper ->error ($ error_type , $ variables );
212
+ throw new \ Exception ( $ this ->helper ->error ($ error_type , $ variables) );
213
213
}
214
214
215
215
// Upload section
@@ -250,8 +250,15 @@ private function uploadValidator($file)
250
250
return $ this ->error ('file-exist ' );
251
251
}
252
252
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
+
253
261
if (config ('lfm.should_validate_mime ' , false )) {
254
- $ mimetype = $ file ->getMimeType ();
255
262
if (false === in_array ($ mimetype , $ this ->helper ->availableMimeTypes ())) {
256
263
return $ this ->error ('mime ' ) . $ mimetype ;
257
264
}
You can’t perform that action at this time.
0 commit comments