mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-02-08 16:18:45 +01:00
Add validation for default links in UserController
This commit is contained in:
parent
a3f5976285
commit
f6124b24aa
@ -201,6 +201,17 @@ class UserController extends Controller
|
|||||||
|
|
||||||
// Step 3: Load Link Type Logic
|
// Step 3: Load Link Type Logic
|
||||||
if($request->typename == 'predefined' || $request->typename == 'link') {
|
if($request->typename == 'predefined' || $request->typename == 'link') {
|
||||||
|
|
||||||
|
$rules = [
|
||||||
|
'link' => 'url',
|
||||||
|
];
|
||||||
|
|
||||||
|
$validator = Validator::make($request->all(), $rules);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return redirect()->back()->withErrors($validator)->withInput();
|
||||||
|
}
|
||||||
|
|
||||||
// Determine button id based on whether a custom or predefined button is used
|
// Determine button id based on whether a custom or predefined button is used
|
||||||
$button_id = ($request->typename == 'link') ? ($request->GetSiteIcon == 1 ? 2 : 1) : null;
|
$button_id = ($request->typename == 'link') ? ($request->GetSiteIcon == 1 ? 2 : 1) : null;
|
||||||
$button = ($request->typename != 'link') ? Button::where('name', $request->button)->first() : null;
|
$button = ($request->typename != 'link') ? Button::where('name', $request->button)->first() : null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user