Skip to content

Commit 91c396b

Browse files
committed
undefine offset o resolved
1 parent e5a35dc commit 91c396b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/Http/Controllers/KchatController.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ function attachments(Request $request){
172172

173173
$tmp = DB::table('settings')->where(['key' => 'uploadpath'])->get();
174174

175+
if(!count($tmp)){
176+
return false;
177+
}
178+
175179
$uploadpath = $tmp[0]->value;
176180

177181
$tmp = $request->all();
@@ -221,10 +225,18 @@ function downattch(Request $request){
221225

222226
$tmp = DB::table('settings')->where(['key' => 'uploadpath'])->get();
223227

228+
if(!count($tmp)){
229+
return false;
230+
}
231+
224232
$uploadpath = $tmp[0]->value;
225233

226234
$pathToFile = $uploadpath.'/'.$file->uuid;
227235

236+
if(!file_exists($pathToFile)){
237+
abort(404);
238+
}
239+
228240
$headers = [
229241
'Content-Type' => $file->MimeType,
230242
];

0 commit comments

Comments
 (0)