require_once unused, class autoloaded
[platal.git] / modules / platal.php
index 0c51235..6077f50 100644 (file)
@@ -84,8 +84,16 @@ class PlatalModule extends PLModule
         $page->changeTpl('platal/changeLog.tpl');
 
         $clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog'));
-        require_once 'url_catcher.inc.php';
-        $clog = url_catcher($clog);
+        // url catch only (not all wiki syntax)
+        $clog = preg_replace(array(
+            '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
+            '/(\s|^)www\.((?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/iu',
+            '/(?:mailto:)?([a-z0-9.\-+_]+@([\-.+_]?[a-z0-9])+)/i'),
+          array(
+            '<a href="\\0">\\0</a>',
+            '\\1<a href="http://www.\\2">www.\\2</a>',
+            '<a href="mailto:\\0">\\0</a>'),
+          $clog);
         $clog = preg_replace('!(#[0-9]+(,[0-9]+)*)!e', 'bugize("\1")', $clog);
         $clog = preg_replace('!vim:.*$!', '', $clog);
         $page->assign('ChangeLog', $clog);
@@ -264,6 +272,15 @@ class PlatalModule extends PLModule
         list($uid, $naissance) = $res->fetchOneRow();
 
         if ($naissance == $birth) {
+            $res = XDB::query("SELECT  COUNT(*)
+                                 FROM  emails
+                                WHERE  uid = {?} AND flags != 'panne' AND flags != 'filter'", $uid);
+            $count = intval($res->fetchOneCell());
+            if ($count == 0) {
+                $page->assign('no_addr', true);
+                return;
+            }
+
             $page->assign('ok', true);
 
             $url   = rand_url_id();