diff --git a/resources/misc/changelogs/en/4.1.2.md b/resources/misc/changelogs/en/4.1.2.md new file mode 100644 index 00000000..a1a697ed --- /dev/null +++ b/resources/misc/changelogs/en/4.1.2.md @@ -0,0 +1,3 @@ +## Fixed + +- Fixed possible error on update page. diff --git a/resources/misc/changelogs/zh_CN/4.1.2.md b/resources/misc/changelogs/zh_CN/4.1.2.md new file mode 100644 index 00000000..8454d86b --- /dev/null +++ b/resources/misc/changelogs/zh_CN/4.1.2.md @@ -0,0 +1,3 @@ +## 修复 + +- 修复升级页面可能的出错 diff --git a/resources/views/setup/updates/welcome.blade.php b/resources/views/setup/updates/welcome.blade.php index 0522496f..7b43913b 100644 --- a/resources/views/setup/updates/welcome.blade.php +++ b/resources/views/setup/updates/welcome.blade.php @@ -8,10 +8,9 @@

{!! nl2br(trans('setup.updates.welcome.text', ['version' => config('app.version')])) !!}

-
- @csrf -

- -

-
+

+ + @lang('setup.updates.welcome.button') + +

@endsection diff --git a/routes/setup.php b/routes/setup.php index 64accf34..24b1f54a 100644 --- a/routes/setup.php +++ b/routes/setup.php @@ -21,6 +21,6 @@ Route::group(['middleware' => 'setup'], function () { Route::post('/finish', 'SetupController@finish'); }); -Route::get('/update', 'SetupController@update'); -Route::post('/update', 'SetupController@doUpdate'); +Route::any('/update', 'SetupController@update'); +Route::any('/exec-update', 'SetupController@doUpdate'); Route::view('/changelog', 'setup.updates.changelog'); diff --git a/tests/SetupControllerTest.php b/tests/SetupControllerTest.php index 1e869af6..8dfe8585 100644 --- a/tests/SetupControllerTest.php +++ b/tests/SetupControllerTest.php @@ -221,13 +221,13 @@ class SetupControllerTest extends TestCase ); // Just a fixture config(['options.new_option' => 'value']); - $this->post('/setup/update')->assertViewHas('tips'); + $this->get('/setup/exec-update')->assertViewHas('tips'); $this->assertEquals('value', option('new_option')); $this->assertEquals('100.0.0', option('version')); unlink(database_path("update_scripts/update-$current_version-to-100.0.0.php")); option(['version' => '3.0.0']); // Fake old version - $this->post('/setup/update'); + $this->get('/setup/exec-update'); $this->assertEquals('100.0.0', option('version')); }