You are here

function _googleanalytics_get_forbidden_tokens in Google Analytics 6.4

Same name and namespace in other branches
  1. 6.3 googleanalytics.admin.inc \_googleanalytics_get_forbidden_tokens()
  2. 7.2 googleanalytics.admin.inc \_googleanalytics_get_forbidden_tokens()
  3. 7 googleanalytics.admin.inc \_googleanalytics_get_forbidden_tokens()
1 call to _googleanalytics_get_forbidden_tokens()
googleanalytics_token_element_validate in ./googleanalytics.admin.inc
Validate a form element that should have tokens in it.

File

./googleanalytics.admin.inc, line 615
Administrative page callbacks for the googleanalytics module.

Code

function _googleanalytics_get_forbidden_tokens($value) {
  $invalid_tokens = array();
  $value_tokens = is_string($value) ? token_scan($value) : $value;

  // For porting/compatibility reasons with _googleanalytics_contains_forbidden_token()
  // the leading and trailing token separator need to be added to every value.
  $value_tokens = token_prepare_tokens($value_tokens);
  foreach ($value_tokens as $token) {

    // If token is forbidden, add it to invalid tokens array.
    if (_googleanalytics_contains_forbidden_token($token)) {
      $invalid_tokens[] = $token;
    }
  }
  array_unique($invalid_tokens);
  return $invalid_tokens;
}