Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve security of AJAX customer search callback function LIKE query #9733

Open
arraypress opened this issue May 22, 2024 · 0 comments
Open
Labels
type-bug workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.

Comments

@arraypress
Copy link
Contributor

Bug Report

Expected behavior

This isn't a bug per-say, but something I noticed that could be improved in the code base. For database search/like queries, it's better to use this syntax:

$search =  sanitize_text_field( $_GET['s'] );
$search_like = '%' . $wpdb->esc_like( $search ) . '%';

Instead of the current way:

$search = esc_sql( sanitize_text_field( $_GET['s'] ) );

@arraypress arraypress added type-bug workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on. labels May 22, 2024
@arraypress arraypress changed the title Improve security of AJAX customer search function LIKE query Improve security of AJAX customer search callback function LIKE query May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug workflow-needs-replication workflow-pending-triage Items that need to be triaged and reviewed before they are worked on.
Projects
None yet
Development

No branches or pull requests

1 participant