Skip to content

refactor: share list and log request validation across pages - #73

Closed
somethingwithproof wants to merge 1 commit into
Cacti:developfrom
somethingwithproof:refactor/consolidate-list-validation
Closed

refactor: share list and log request validation across pages#73
somethingwithproof wants to merge 1 commit into
Cacti:developfrom
somethingwithproof:refactor/consolidate-list-validation

Conversation

@somethingwithproof

Copy link
Copy Markdown
Member

The urls, servers and proxies pages each hand-built the same rows, page, refresh, sort and state filter arrays before validate_store_request_vars, so the three copies had already drifted (the servers log key carried a sess_weseer typo).

This moves the two filter sets into webseer_validate_list_request and webseer_validate_log_request in includes/functions.php; each page passes only its session key, sort default, refresh default and which optional filters apply. Session keys, including the existing typo, are preserved verbatim, so stored filters are unaffected.

No behavior change: the (session, filters) produced by every call site is byte-identical to before. Net -79 lines.

The urls, servers and proxies pages each hand-built the same rows, page,
refresh, sort and state filter arrays before validate_store_request_vars,
so the three copies drifted (the servers log key kept a sess_weseer typo).
Move the two filter sets into webseer_validate_list_request and
webseer_validate_log_request in includes/functions.php and pass only the
session key, sort default, refresh default and which optional filters
apply. Session keys, including the existing typo, are preserved verbatim.

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
@somethingwithproof

Copy link
Copy Markdown
Member Author

Folded into #65 (25de11c) so the webseer hardening reviews as one PR. The validation consolidation is byte-identical to before (verified: every call site produces the same filters array and session key), and the sess_weseer_server_log key is preserved verbatim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant