Skip to content

Commit

Permalink
fix(users): Ensure var is an integer and then +2
Browse files Browse the repository at this point in the history
  • Loading branch information
zooley committed Aug 10, 2023
1 parent 7e4b1c3 commit b1eb540
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/Modules/Users/Http/Controllers/Site/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ public function account(Request $request)

// `segment()` is NOT zero-indexed. "account" will be segment 1
$pos = array_search('account', $request->segments());
$i = $pos ? $pos + 2 : 0;
$i = is_int($pos) ? $pos : 0;
$i = $i + 2;

event($event = new UserDisplay($user, $request->segment($i)));
$sections = collect($event->getSections());
Expand Down

0 comments on commit b1eb540

Please sign in to comment.