mirror of
https://github.com/projectsend/projectsend.git
synced 2026-09-16 16:45:07 +00:00
d19ec11970
update() validated preferences.*.type as ['required', 'string'], so any string at all became a row in notification_preferences. Nothing reads it afterwards: emailEnabledFor() looks preferences up by a key the registry knows, so a row under an unknown key is invisible for good. It is not a way into somebody else's settings — user_id comes from the session, never the payload — which is why this is validation rather than authorization. The cost is a table that quietly accumulates rows nobody can see, explain, or remove through the interface. edit() already knew the answer. It filters the registry down to the types that can email at all, by either route, and renders exactly those as toggles. That list is now derived once and used by both halves, so what the screen offers and what it accepts back cannot drift apart. Rejecting a registered-but-unmailable key (client_uploaded is the one in tree) is deliberate rather than incidental: FilesServiceProvider explains that it has no mail companion on purpose, so a preference row for it could never change what anybody receives.