Stop visitors from writing to the live table.

save_data() trusted the action and id in the POST data. A visitor can
now only add a new story to the queue, and cannot delete.
This commit is contained in:
tim
2026-09-25 21:25:43 +02:00
parent 00829a0c0d
commit 0e5e742210
2 changed files with 26 additions and 9 deletions
+4 -2
View File
@@ -338,8 +338,10 @@ function which_table($move = FALSE, $action = 'read') {
global $is_admin;
$queue = get_queue();
// Editing
if ($action == 'delete' && $move && $is_admin) {
// Editing: a visitor can never write to the live table
if (!$is_admin && in_array($action, array('post', 'save', 'submit', 'delete'))) {
return 'queue';
} else if ($action == 'delete' && $move && $is_admin) {
return 'queue';
} else if ($action == 'post' && $is_admin) {
return 'xxx';