-function enriched_to_text($input,$html=false,$just=false,$indent=0,$width=68)
-{
- $text = trim($input);
- if ($html) {
- $text = htmlspecialchars($text);
- $text = str_replace('[b]','<strong>', $text);
- $text = str_replace('[/b]','</strong>', $text);
- $text = str_replace('[i]','<em>', $text);
- $text = str_replace('[/i]','</em>', $text);
- $text = str_replace('[u]','<span style="text-decoration: underline">', $text);
- $text = str_replace('[/u]','</span>', $text);
- require_once('url_catcher.inc.php');
- $text = url_catcher($text);
- return nl2br($text);
- } else {
- $text = preg_replace('!\[\/?b\]!','*',$text);
- $text = preg_replace('!\[\/?u\]!','_',$text);
- $text = preg_replace('!\[\/?i\]!','/',$text);
- $text = preg_replace('!(((https?|ftp)://|www\.)[^\r\n\t ]*)!','[\1]', $text);
- $text = preg_replace('!(([a-zA-Z0-9\-_+.]*@[a-zA-Z0-9\-_+.]*)(?:\?[^\r\n\t ]*)?)!','[mailto:\1]', $text);
- $text = $just ? justify($text,$width-$indent) : wordwrap($text,$width-$indent);
- if($indent) {
- $ind = str_pad('',$indent);
- $text = $ind.str_replace("\n","\n$ind",$text);
+ public function getLinkIps(&$blacklist_host_resolution_count)
+ {
+ $matches = $this->parseUrlsFromArticle();
+ $article_ips = array();
+
+ if (!empty($matches)) {
+ global $globals;
+
+ foreach ($matches as $match) {
+ $host = parse_url($match, PHP_URL_HOST);
+ if ($host == '') {
+ list(, $host) = explode('@', $match);
+ }
+
+ if ($blacklist_host_resolution_count >= $globals->mail->blacklist_host_resolution_limit) {
+ break;
+ }
+
+ if (!preg_match('/^(' . str_replace(' ', '|', $globals->mail->domain_whitelist) . ')$/i', $host)) {
+ $article_ips = array_merge($article_ips, array(gethostbyname($host) => $host));
+ ++$blacklist_host_resolution_count;
+ }
+ }