Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8497ac5

Browse filesBrowse files
committed
wip
1 parent 7910268 commit 8497ac5
Copy full SHA for 8497ac5

File tree

Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-1
lines changed

‎src/Components/Form/Wrapper.php

Copy file name to clipboardExpand all lines: src/Components/Form/Wrapper.php
+16-1Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function __construct($method = "POST", $action = "dashboard")
4040
{
4141
$this->id = 'form-' . Str::kebab(class_basename(get_class($this))) . '-' . md5($action);
4242
$this->method = $method;
43-
$this->action = Admin::route($action);
43+
$this->action = $this->getActionURLFromString($action);
4444
}
4545

4646
/**
@@ -52,4 +52,19 @@ public function render()
5252
{
5353
return view('components::form.wrapper');
5454
}
55+
56+
/**
57+
* Return URL action from the provided string
58+
*
59+
* @param string $action
60+
*
61+
* @return string
62+
*/
63+
private function getActionURLFromString($action) {
64+
if (filter_var($action, FILTER_VALIDATE_URL)) {
65+
return $action;
66+
} else {
67+
return route($action);
68+
}
69+
}
5570
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.