Return a 409 Conflict instead of a 200 OK on an edit conflict when saving a page in the save action

This commit is contained in:
Starbeamrainbowlabs 2022-05-25 23:50:55 +01:00
parent 5b0619b0a2
commit 49a675c042
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
2 changed files with 2 additions and 0 deletions

View File

@ -14,6 +14,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
### Changed
- Display returnto URL above the login form if present to further mitigate CSRF issues
- [Rest API] Return a 409 Conflict instead of a 200 OK on an edit conflict when saving a page in the `save` action
### Fixed
- Stats: Fix crash when loading the stats page

View File

@ -503,6 +503,7 @@ DIFFSCRIPT;
page_renderer::add_js_link("$paths->extra_data_directory/page-edit/diff.min.js");
page_renderer::add_js_snippet($diff_script);
http_response_code(409);
header("x-failure-reason: edit-conflict");
exit(page_renderer::render_main("Edit Conflict - $env->page - $settings->sitename", $content));
}