🔧 Apporte des modifications de rétro-compatibilité
This commit is contained in:
@@ -14,14 +14,16 @@ class LinksController extends BaseController
|
||||
/** @var User $user */
|
||||
$user = $request->user()->first();
|
||||
$email = $user->email;
|
||||
|
||||
$link = $request->input('link');
|
||||
|
||||
$link = $request->input('u');
|
||||
$link = filter_var($link, FILTER_VALIDATE_URL);
|
||||
if ($link === false) {
|
||||
return response()->json(['error' => 'Invalid link.'], 422);
|
||||
}
|
||||
|
||||
$email_sent = mail($email, 'New link', $link);
|
||||
$title = $request->input('t') ?: '';
|
||||
|
||||
$email_sent = mail($email, 'New link : '.$title, $link);
|
||||
|
||||
if ($email_sent) {
|
||||
return response()->json(['info' => 'Email sent.']);
|
||||
|
Reference in New Issue
Block a user