public function whiteList($text) {
    // Fetch allowed patterns.
    $patterns = $this->getPatterns();

    // Check if the URL provided is from a whitelisted site.
    foreach ($patterns as $pattern) {
      // Testing pattern.
      $testing_pattern = '/' . $pattern . '/';
      // Check if it matches.
      if (preg_match($testing_pattern, $text)) {
        return TRUE;
      }
    }
    return FALSE;
  }
public function whiteList($text) {
    // Fetch allowed patterns.
    $patterns = $this->getPatterns();

    // Check if the URL provided is from a whitelisted site.
    foreach ($patterns as $pattern) {
      // Testing pattern.
      $testing_pattern = '/' . $pattern . '/';
      // Check if it matches.
      if (preg_match($testing_pattern, $text)) {
        return TRUE;
      }
    }
    return FALSE;
  }
public function whiteList ( $ text ) { // Fetch allowed patterns. $ patterns = $ this -> getPatterns ( ) ; // Check if the URL provided is from a whitelisted site. foreach ( $ patterns as $ pattern ) { // Testing pattern. $ testing_pattern = '/' . $ pattern . '/' ; // Check if it matches. if ( preg_match ( $ testing_pattern , $ text ) ) { return TRUE ; } } return FALSE ; }
Checks if item is on the whitelist.

@param string $text
The item to check for.

@return bool
Return if the item is on the whitelist or not.
Checks if item is on the whitelist .