typos
[platal.git] / include / validations / evts.inc.php
index 4a3a0ce..ed22c95 100644 (file)
@@ -136,7 +136,7 @@ class EvtReq extends Validate
     {
         if (XDB::execute("INSERT INTO  evenements
                          SET  user_id = {?}, creation_date=NOW(), titre={?}, texte={?},
-                              peremption={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide')",
+                              peremption={?}, promo_min={?}, promo_max={?}, flags=CONCAT(flags,',valide,wiki')",
                 $this->uid, $this->titre, $this->texte,
                 $this->peremption, $this->pmin, $this->pmax)) {
             $eid = XDB::insertId();
@@ -151,14 +151,9 @@ class EvtReq extends Validate
                 $forlife = get_user_forlife($this->uid);
                 require_once 'banana/forum.inc.php';
                 $banana = new ForumsBanana($forlife);
-                $text = strip_tags($this->texte, '<p><br><li><ul><ol><a>');
-                $text = preg_replace(',<a href="([^"]+)">(.*?)</a>,', '$1', $text);
-                $text = preg_replace('/<li>/', '* ', $text);
-                $text = preg_replace(',</?.+?>,i', "\n", $text);
-                $text = preg_replace("/\n{2,}/", "\n\n", $text);
                 $post = $banana->post($globals->banana->event_forum,
                                       $globals->banana->event_reply,
-                                      $this->titre, pl_entity_decode($text));
+                                      $this->titre, MiniWiki::wikiToText($this->texte, false, 0, 80));
                 if ($post != -1) {
                     XDB::execute("UPDATE  evenements
                                      SET  creation_date = creation_date, post_id = {?}