Update core
[platal.git] / modules / carnet.php
index fc0d8f9..afd1a31 100644 (file)
@@ -79,7 +79,7 @@ class CarnetModule extends PLModule
 
     private function getSinglePromotion(PlPage &$page, $promo)
     {
-        if (!ctype_digit($promo) || $promo < 1920 || $promo > date('Y')) {
+        if (!(is_int($promo) || ctype_digit($promo)) || $promo < 1920 || $promo > date('Y')) {
             $page->trigError('Promotion invalide&nbsp;: ' . $promo . '.');
             return null;
         }
@@ -255,7 +255,7 @@ class CarnetModule extends PLModule
         $this->_add_rss_link($page);
 
         $uid  = S::i('uid');
-        $user = Env::v('user');
+        $user = S::user();
 
         // For XSRF protection, checks both the normal xsrf token, and the special RSS token.
         // It allows direct linking to contact adding in the RSS feed.
@@ -285,7 +285,6 @@ class CarnetModule extends PLModule
         }
 
         $search = false;
-        $user = S::user();
 
         require_once 'userset.inc.php';
 
@@ -296,8 +295,6 @@ class CarnetModule extends PLModule
         }
         if ($search && trim(Env::v('quick'))) {
             $base = 'carnet/contacts/search';
-
-            Platal::load('search', 'classes.inc.php');
             $view = new SearchSet(true, false, new UFC_Contact($user));
         } else {
             $base = 'carnet/contacts';