How to avoid bypass of search bar rules?
-
Hi, I’m building my site locally.
Since I want users to be able to write only specific terms in the search bar, I put a jQuery script in the wp-content\themes\sitename\js folder.
The script works fine, but I noticed that the script can be bypassed in a simple way.
For example, suppose that the search bar accepts only strings with 3 characters, so if I write “abcd” and press enter I get an error, but if I write “abc” and press enter then it works and the “Search Results” page will have the url
https://localhost/sitename/?s=abc
But it’s enough to modify the url to be
https://localhost/sitename/?s=abcd
and press enter, to bypass the search bar script.
How to avoid this?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to avoid bypass of search bar rules?’ is closed to new replies.