refactor: share list and log request validation across pages - #73
Closed
somethingwithproof wants to merge 1 commit into
Closed
refactor: share list and log request validation across pages#73somethingwithproof wants to merge 1 commit into
somethingwithproof wants to merge 1 commit into
Conversation
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>
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 asess_weseertypo).This moves the two filter sets into
webseer_validate_list_requestandwebseer_validate_log_requestinincludes/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.