static function bad_protocol_once2($matches) { global $aprotocols; $allowed_protocols = $aprotocols; if (is_array($matches)) { if (!isset($matches[1]) || empty($matches[1])) { return ''; } $string = $matches[1]; } else { $string = $matches; } $string2 = TextCleaner::decode_entities($string); $string2 = preg_replace('/\\s/', '', $string2); $string2 = TextCleaner::no_null($string2); $string2 = strtolower($string2); $allowed = false; foreach ((array) $allowed_protocols as $one_protocol) { if (strtolower($one_protocol) == $string2) { $allowed = true; break; } } if ($allowed) { return "{$string2}:"; } else { return ''; } }