Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $blockedQueries = ["query1", "query2"];
- array_walk($blockedQueries, 'preg_quote');
- $pattern = implode("|", $blockedQueries);
- if (preg_match("/{$pattern}/i", $query) === 1) {
- if (is_ajax()) {
- return json(['redirect' => url_for('site.home')]);
- }
- return redirect_to('site.home');
- }
Advertisement
Add Comment
Please, Sign In to add comment