Skip to content

Commit dd5f6a3

Browse files
committed
fix: pass form handle context to decrypt() in query builder path
1 parent 566cd2f commit dd5f6a3

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Instructions for AI agents working in this repository.
3535
- Listeners auto-discovered from `src/Listeners/`, translations from `lang/`.
3636
- Encryption: `Crypt::encryptString` with `enc:v1:` marker prefix. No double encryption.
3737
- Handle decrypt failures gracefully — log warning, return raw ciphertext.
38+
- `DecryptingSubmissionRepository` and `DecryptingSubmissionQueryBuilder` mirror identical `decryptSubmission()` / `isAuthorizedForForm()` logic. Any change to either file **must** be applied to the other.
3839
- Field config toggle scoped to `Text` and `Textarea` fieldtypes only (not global `Fieldtype::`).
3940
- Permission: `view decrypted sensitive fields`. Super admins always authorized.
4041
- Compatible with both Stache (flat-file) and Eloquent Driver.

src/Repositories/DecryptingSubmissionQueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected function decryptSubmission(Submission $submission): void
8181
}
8282

8383
if ($canDecrypt) {
84-
$submission->set($handle, $this->encryptor->decrypt($value));
84+
$submission->set($handle, $this->encryptor->decrypt($value, $submission->form()->handle()));
8585
} else {
8686
$submission->set($handle, $this->encryptor->mask());
8787
}

0 commit comments

Comments
 (0)