From f2918d3b24162b28eb46f85570a12a37fc220c88 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Wed, 19 Oct 2022 19:40:10 +0200 Subject: [PATCH] Optimized use of profile URLs without prefix (Set in advanced config) --- routes/web.php | 3 ++- storage/templates/advanced-config.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 4ce3ccd..0f2a4f1 100755 --- a/routes/web.php +++ b/routes/web.php @@ -61,7 +61,8 @@ Route::get('/panel/diagnose', function () { //Public route $custom_prefix = config('advanced-config.custom_url_prefix'); Route::get('/going/{id?}/{link?}', [UserController::class, 'clickNumber'])->where('link', '.*')->name('clickNumber'); -Route::get('/' . $custom_prefix . '{littlelink}', [UserController::class, 'littlelink'])->name('littlelink'); +if (!str_contains(url()->full(), '@') and !in_array(url()->full(), [url('login'), url('register'), url('update'), url('updating'), url('backup')])) { +Route::get('/' . $custom_prefix . '{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');} Route::get('/@{littlelink}', [UserController::class, 'littlelink'])->name('littlelink'); Route::get('/pages/{name}', [AdminController::class, 'pages'])->name('pages'); Route::get('/theme/@{littlelink}', [UserController::class, 'theme'])->name('theme'); diff --git a/storage/templates/advanced-config.php b/storage/templates/advanced-config.php index 7b49c5d..a107e82 100644 --- a/storage/templates/advanced-config.php +++ b/storage/templates/advanced-config.php @@ -105,7 +105,7 @@ return [ // The URL prefix is the symbol that comes before a LittleLink URL. // For example the '@' in 'example.com/@admin'. - // If empty no prefix is required. Use with caution. + // If empty no prefix is required. 'custom_url_prefix' => '+', // The '@' prefix will always work regardless of this setting.