MirazMac

Untitled

Jun 14th, 2021
495
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.         $blockedQueries = ["query1", "query2"];
  3.  
  4.         array_walk($blockedQueries, 'preg_quote');
  5.  
  6.         $pattern = implode("|", $blockedQueries);
  7.  
  8.         if (preg_match("/{$pattern}/i", $query) === 1) {
  9.             if (is_ajax()) {
  10.                 return json(['redirect' => url_for('site.home')]);
  11.             }
  12.  
  13.             return redirect_to('site.home');
  14.         }
RAW Paste Data