diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/Http/Controllers/LinkController.php | 8 | ||||
-rw-r--r-- | app/Http/Controllers/UserController.php | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/app/Http/Controllers/LinkController.php b/app/Http/Controllers/LinkController.php index d38b7ee..161ef30 100644 --- a/app/Http/Controllers/LinkController.php +++ b/app/Http/Controllers/LinkController.php @@ -16,9 +16,7 @@ class LinkController extends Controller { */ private function renderError($message) { - $this->request->session()->flash('error', $message); - - return redirect()->route('index'); + return redirect(route('index'))->with('error', $message); } private function formatAndRender($link_ending, $secret_ending=False) { @@ -40,7 +38,7 @@ class LinkController extends Controller { $is_already_short = LinkHelper::checkIfAlreadyShortened($long_url); if ($is_already_short) { - return $this->renderError('Sorry, but your link already + return $this->renderError('Sorry, but your link already\ looks like a shortened URL.'); } @@ -54,7 +52,7 @@ class LinkController extends Controller { // has custom ending $ending_conforms = LinkHelper::validateEnding($custom_ending); if (!$ending_conforms) { - return $this->renderError('Sorry, but custom endings + return $this->renderError('Sorry, but custom endings\ can only contain alphanumeric characters'); } diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 2a1a747..45e0c35 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -47,7 +47,7 @@ class UserController extends Controller { public function performSignup(Request $request) { if (env('POLR_ALLOW_ACCT_CREATION') == false) { - return redirect('index')->with('error', 'Sorry, but registration is disabled.'); + return redirect(route('index'))->with('error', 'Sorry, but registration is disabled.'); } $username = $request->input('username'); |