You are here

public function GoogleCSEServices::cleanString in Google Custom Search Engine 8.2

Same name and namespace in other branches
  1. 8.3 src/GoogleCSEServices.php \Drupal\google_cse\GoogleCSEServices::cleanString()

Clean string of html, tags, etc...

Parameters

string $input_str: The original string.

Return value

string The cleaned output.

1 call to GoogleCSEServices::cleanString()
GoogleCSEServices::responseResults in src/GoogleCSEServices.php
Function to fetch the results xml from Google.

File

src/GoogleCSEServices.php, line 442

Class

GoogleCSEServices
Additional functions as services for Google CSE.

Namespace

Drupal\google_cse

Code

public function cleanString($input_str) {
  $cleaned_str = $input_str;
  if (function_exists('htmlspecialchars_decode')) {
    $cleaned_str = htmlspecialchars_decode($input_str, ENT_QUOTES);
  }

  // Remove possible tags.
  $cleaned_str = strip_tags($cleaned_str);
  return $cleaned_str;
}