Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
munafio committed Jun 19, 2021
1 parent 79425e0 commit 208db4d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file.

## v1.2.3 - (2021-06-19)

### Fixed

- XSS issue on inputs.
- UI/UX fixes & improvements.
- Send message fixes (UI & backend).
- Update Profile Settings (upload file & error handling ….).
- Shared photos not working issue.
- Typo error fixes (Your `contatc` list is empty).
- Rolling back migrations added.
- Get Last message `orderBy` query duplication.

## v1.2.2 - (2021-06-01)

### Fixed
Expand Down
18 changes: 12 additions & 6 deletions src/Http/Controllers/MessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ public function download($fileName)
public function send(Request $request)
{
// default variables
$error_msg = $attachment = $attachment_title = null;
$error = (object)[
'status' => 0,
'message' => null
];
$attachment = null;
$attachment_title = null;

// if there is attachment [file]
if ($request->hasFile('file')) {
Expand All @@ -135,14 +140,16 @@ public function send(Request $request)
$attachment = Str::uuid() . "." . $file->getClientOriginalExtension();
$file->storeAs("public/" . config('chatify.attachments.folder'), $attachment);
} else {
$error_msg = "File extension not allowed!";
$error->status = 1;
$error->message = "File extension not allowed!";
}
} else {
$error_msg = "File size is too long!";
$error->status = 1;
$error->message = "File extension not allowed!";
}
}

if (!$error_msg) {
if (!$error->status) {
// send to database
$messageID = mt_rand(9, 999999999) + time();
Chatify::newMessage([
Expand Down Expand Up @@ -171,8 +178,7 @@ public function send(Request $request)
// send the response
return Response::json([
'status' => '200',
'error' => $error_msg ? 1 : 0,
'error_msg' => $error_msg,
'error' => $error,
'message' => Chatify::messageCard(@$messageData),
'tempID' => $request['temporaryMsgId'],
]);
Expand Down

0 comments on commit 208db4d

Please sign in to comment.