/** MakeLink * @param string Link * @return string */ function MakeLink($Link) { $antibot = EMAIL_ANTISPAM_TEXT; $encodedLink = encodeUri($Link); // identify mail-adresses if (preg_match("/^[a-z0-9-_\\.]+@[a-z0-9\\[\\]-_\\.]+\\.[a-z]{2,4}\$/i", $Link)) { // only a replacement of "dots" and the "at" if ($antibot == EMAIL_ANTISPAM_TEXT) { $Link = str_replace('.', ' [dot] ', $Link); $Link = str_replace('@', ' [at] ', $Link); } else { if ($antibot == EMAIL_ANTISPAM_ASCII) { $tmpMail = ''; $length = strlen($Link); for ($chr = 0; $chr < $length; $chr++) { $tmpMail .= '&#' . ord($Link[$chr]) . ';'; } $Link = $tmpMail; } } return "mailto:{$Link}\" class=\"link_email"; } else { if (substr($encodedLink, 0, 6) == 'http:/' || substr($encodedLink, 0, 5) == 'ftp:/' || substr($encodedLink, 0, 7) == 'https:/') { return "{$encodedLink}\" class=\"link_extern"; } } return TextActions::GetInternUrl($encodedLink); }
/** MakeLink * @param string Link * @return string */ function MakeLink($Link) { $antibot = EMAIL_ANTISPAM_TEXT; $encodedLink = encodeUri($Link); // identify mail-adresses if (preg_match("/^[a-z0-9-_\\.]+@[a-z0-9\\-_\\.]+\\.[a-z]{2,4}\$/i", $Link)) { $Link = TextActions::EmailAntispam($Link, $antibot); return "mailto:{$Link}\" class=\"link_email"; } else { if (substr($encodedLink, 0, 6) == 'http:/' || substr($encodedLink, 0, 5) == 'ftp:/' || substr($encodedLink, 0, 7) == 'https:/') { return "{$encodedLink}\" class=\"link_extern"; } else { if (substr($encodedLink, 0, 11) == 'download%3A') { return TextActions::GetDownloadUrl(substr($encodedLink, 11)); } } } return TextActions::GetInternUrl($encodedLink); }