Try to avoid using site url which ends with index.php #101

This commit is contained in:
printempw 2017-11-07 21:40:53 +08:00
parent 788a30a26e
commit 0f065ef202
2 changed files with 16 additions and 3 deletions

View File

@ -108,8 +108,14 @@ class AdminController extends Controller
$form->text('site_url')
->hint()
->format(function ($url) {
if (ends_with($url, '/'))
if (ends_with($url, '/')) {
$url = substr($url, 0, -1);
}
if (ends_with($url, '/index.php')) {
$url = substr($url, 0, -10);
}
return $url;
});

View File

@ -57,7 +57,14 @@ class SetupController extends Controller
Log::info("[SetupWizard] Tables migrated.");
Option::set('site_name', $request->input('site_name'));
Option::set('site_url', url('/'));
$siteUrl = url('/');
if (ends_with($siteUrl, '/index.php')) {
$siteUrl = substr($siteUrl, 0, -10);
}
Option::set('site_url', $siteUrl);
// register super admin
$user = User::register(
@ -137,7 +144,7 @@ class SetupController extends Controller
Artisan::call('view:clear');
} catch (\Exception $e) {
Log::error('Error occured when processing view:clear', $e);
File::cleanDirectory(storage_path('framework/views'));
}