Security: scope set_recurring_payment to the client's own invoice and payment method

This commit is contained in:
johnnyq
2026-10-08 16:02:21 -04:00
parent 2c8fb8753c
commit 5acb1802bb
2 changed files with 20 additions and 1 deletions

View File

@@ -567,10 +567,16 @@ if (isset($_POST['set_recurring_payment'])) {
saved_payment_description FROM payment_providers
LEFT JOIN client_saved_payment_methods ON saved_payment_provider_id = payment_provider_id
WHERE saved_payment_id = $saved_payment_id
AND saved_payment_client_id = $client_id
");
$row = mysqli_fetch_assoc($sql);
if (!$row) {
flashAlert("Payment method not found for this client.", 'error');
redirect();
}
$provider_id = intval($row['payment_provider_id']);
$provider_name = escapeSql($row['payment_provider_name']);
$account_id = intval($row['payment_provider_account']);