Fixed errors with empty custom URL prefix

https://github.com/LinkStackOrg/LinkStack/issues/451
This commit is contained in:
Julian Prieber 2023-05-25 20:12:37 +02:00
parent 7a26449daf
commit f939dcac88
1 changed files with 6 additions and 3 deletions

View File

@ -85,8 +85,7 @@ Route::get('/panel/diagnose', function () {
//Public route //Public route
$custom_prefix = config('advanced-config.custom_url_prefix'); $custom_prefix = config('advanced-config.custom_url_prefix');
Route::get('/going/{id?}', [UserController::class, 'clickNumber'])->where('link', '.*')->name('clickNumber'); Route::get('/going/{id?}', [UserController::class, 'clickNumber'])->where('link', '.*')->name('clickNumber');
if (!str_contains(url()->full(), '@') and !in_array(url()->full(), [url('login'), url('register'), url('update'), url('update?error='), url('update?success='), url('update?finishing='), url('update?updating='), url('update?backups='), url('update?backup='), url('update?updating-windows='), url('update?preparing='), url('updating'), url('backup')])) { if($custom_prefix != ""){Route::get('/' . $custom_prefix . '{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');}}
Route::get('/' . $custom_prefix . '{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');}
Route::get('/@{littlelink}', [UserController::class, 'littlelink'])->name('littlelink'); Route::get('/@{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');
Route::get('/pages/'.strtolower(env('TITLE_FOOTER_TERMS')), [AdminController::class, 'pagesTerms'])->name('pagesTerms'); Route::get('/pages/'.strtolower(env('TITLE_FOOTER_TERMS')), [AdminController::class, 'pagesTerms'])->name('pagesTerms');
Route::get('/pages/'.strtolower(env('TITLE_FOOTER_PRIVACY')), [AdminController::class, 'pagesPrivacy'])->name('pagesPrivacy'); Route::get('/pages/'.strtolower(env('TITLE_FOOTER_PRIVACY')), [AdminController::class, 'pagesPrivacy'])->name('pagesPrivacy');
@ -224,6 +223,11 @@ Route::group([
}); // ENd Admin authenticated routes }); // ENd Admin authenticated routes
}); });
if(config('advanced-config.custom_url_prefix') == ""){
Route::get('/{littlelink}', [UserController::class, 'littlelink'])->name('littlelink');
}
// Displays Maintenance Mode page // Displays Maintenance Mode page
if(env('MAINTENANCE_MODE') == 'true' or file_exists(base_path("storage/MAINTENANCE"))){ if(env('MAINTENANCE_MODE') == 'true' or file_exists(base_path("storage/MAINTENANCE"))){
Route::get('/{any}', function () { Route::get('/{any}', function () {
@ -231,6 +235,5 @@ Route::get('/{any}', function () {
})->where('any', '.*'); })->where('any', '.*');
} }
}
require __DIR__.'/auth.php'; require __DIR__.'/auth.php';