You are here

function google_cse_validate_request in Google Custom Search Engine 7.2

Same name and namespace in other branches
  1. 8.3 google_cse.theme.inc \google_cse_validate_request()
  2. 8.2 google_cse.theme.inc \google_cse_validate_request()
  3. 7.3 google_cse.theme.inc \google_cse_validate_request()
  4. 7 google_cse.theme.inc \google_cse_validate_request()

Validate GET parameters to avoid displaying inappropriate search results.

1 call to google_cse_validate_request()
template_preprocess_google_cse_results in ./google_cse.theme.inc
The search results page can be themed/customized.

File

./google_cse.theme.inc, line 58
Themeable functions for Google Custom Search Engine.

Code

function google_cse_validate_request() {
  return (empty($_GET['cx']) || $_GET['cx'] == variable_get('google_cse_cx', '')) && (empty($_GET['safe']) || $_GET['safe'] == variable_get('google_cse_safe', '')) && (empty($_GET['sitesearch']) || ($options = google_cse_sitesearch_options()) && isset($options[$_GET['sitesearch']]));
}