Passed
Push — main ( bdbaee...80491e )
by Julian
16:21 queued 10:39
created
app/Http/Controllers/UserController.php 1 patch
Braces   +19 added lines, -11 removed lines patch added patch discarded remove patch
@@ -184,17 +184,23 @@  discard block
 block discarded – undo
184 184
     
185 185
         $customParams = [];
186 186
         foreach ($request->all() as $key => $param) {
187
-            if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) continue;
187
+            if (str_starts_with($key, "_") || in_array($key, ['linktype_id', 'linktype_title', 'link_text', 'link_url'])) {
188
+                continue;
189
+            }
188 190
             $customParams[$key] = $param;
189 191
         }
190 192
     
191 193
         $userId = Auth::user()->id;
192 194
         $button = Button::where('name', $request->button)->first();
193
-        if ($button && empty($LinkTitle)) $LinkTitle = $button->alt;
195
+        if ($button && empty($LinkTitle)) {
196
+            $LinkTitle = $button->alt;
197
+        }
194 198
     
195 199
         if ($linkType->typename == 'video' && empty($LinkTitle)) {
196 200
             $embed = OEmbed::get($LinkURL);
197
-            if ($embed) $LinkTitle = $embed->data()['title'];
201
+            if ($embed) {
202
+                $LinkTitle = $embed->data()['title'];
203
+            }
198 204
         }
199 205
     
200 206
         $message = (ucwords($button?->name) ?? ucwords($linkType->typename)) . " has been ";
@@ -477,14 +483,16 @@  discard block
 block discarded – undo
477 483
             'button' => 'required',
478 484
         ]);
479 485
 
480
-        if (stringStartsWith($request->link, 'http://') == 'true' or stringStartsWith($request->link, 'https://') == 'true' or stringStartsWith($request->link, 'mailto:') == 'true')
481
-            $link1 = $request->link;
482
-        else
483
-            $link1 = 'https://' . $request->link;
484
-        if (stringEndsWith($request->link, '/') == 'true')
485
-            $link = rtrim($link1, "/ ");
486
-        else
487
-        $link = $link1;
486
+        if (stringStartsWith($request->link, 'http://') == 'true' or stringStartsWith($request->link, 'https://') == 'true' or stringStartsWith($request->link, 'mailto:') == 'true') {
487
+                    $link1 = $request->link;
488
+        } else {
489
+                    $link1 = 'https://' . $request->link;
490
+        }
491
+        if (stringEndsWith($request->link, '/') == 'true') {
492
+                    $link = rtrim($link1, "/ ");
493
+        } else {
494
+                $link = $link1;
495
+        }
488 496
         $title = $request->title;
489 497
         $order = $request->order;
490 498
         $button = $request->button;
Please login to merge, or discard this patch.