Highlight active dashboard stats card#278
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| $current_link_type = 'all'; | ||
| if (isset($_GET['link_type'])) { | ||
| $link_type_param = sanitize_key(wp_unslash($_GET['link_type'])); | ||
| if ($link_type_param !== '') { |
There was a problem hiding this comment.
Guard sanitize_key against array input
The new link_type detection calls sanitize_key( wp_unslash( $_GET['link_type'] ) ) without validating the query parameter’s shape. If someone hits the dashboard with ?link_type[]=foo (or any non‑scalar value), sanitize_key() feeds that array into strtolower() and PHP 8 throws a fatal TypeError, breaking the entire page. Consider ensuring $_GET['link_type'] is a scalar before sanitizing or casting so the dashboard can’t be taken down by a malformed request.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68e03b9e529c832e8ed2333db099b8fc