X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fnewsletter.inc.php;h=a8c424ea3d6937702131c37324fd0eb0232c8815;hb=9e1816c7666767755abbc24f6a0df290efff81b6;hp=b03b419b14442bca7c8b55ea9465cb2d5b4d8a4a;hpb=9e2a6a32494b965216ec6c4a07dc37a7a15fc365;p=platal.git diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index b03b419..a8c424e 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -1,6 +1,6 @@ numRows()) { - Newsletter::create(); + NewsLetter::create(); } - $res = XDB::query("SELECT * FROM newsletter WHERE bits='new'"); + $res = XDB::query("SELECT * FROM newsletter WHERE bits='new' ORDER BY id DESC LIMIT 1"); } if ($res->numRows() != 1) { throw new MailNotFound(); @@ -308,7 +308,7 @@ class NLArticle // }}} // {{{ function getLinkIps() - public function getLinkIps(&$gethostbyname_count) + public function getLinkIps(&$blacklist_host_resolution_count) { $matches = $this->parseUrlsFromArticle(); $article_ips = array(); @@ -322,14 +322,13 @@ class NLArticle list(, $host) = explode('@', $match); } - if ($gethostbyname_count < $globals->mail->blacklist_host_resolution_limit) { + if ($blacklist_host_resolution_count >= $globals->mail->blacklist_host_resolution_limit) { break; } - if ($host != $globals->mail->alias_dom && $host != $globals->mail->alias_dom2 - && $host != $globals->mail->domain && $host != $globals->mail->domain2) { + if (!preg_match('/^(' . str_replace(' ', '|', $globals->mail->domain_whitelist) . ')$/i', $host)) { $article_ips = array_merge($article_ips, array(gethostbyname($host) => $host)); - ++$gethostbyname_count; + ++$blacklist_host_resolution_count; } } }