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;
  }