1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-24 17:13:01 +00:00

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 ### Changed
- Display returnto URL above the login form if present to further mitigate CSRF issues - 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 ### Fixed
- Stats: Fix crash when loading the stats page - 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_link("$paths->extra_data_directory/page-edit/diff.min.js");
page_renderer::add_js_snippet($diff_script); page_renderer::add_js_snippet($diff_script);
http_response_code(409);
header("x-failure-reason: edit-conflict"); header("x-failure-reason: edit-conflict");
exit(page_renderer::render_main("Edit Conflict - $env->page - $settings->sitename", $content)); exit(page_renderer::render_main("Edit Conflict - $env->page - $settings->sitename", $content));
} }