#545: Should be better with this
[platal.git] / modules / xnetgrp.php
index 47de695..ee3aaa7 100644 (file)
@@ -730,6 +730,7 @@ class XnetGrpModule extends PLModule
 
     function handler_admin_member_new_ajax(&$page)
     {
+        header('Content-Type: text/html; charset="iso-8859-15"');
         $page->changeTpl('xnet/groupe/membres-new-search.tpl', NO_SKIN);
         list($nom, $prenom) = str_replace(array('-', ' ', "'"), '%', array(Env::v('nom'), Env::v('prenom')));
         $where = "perms = 'pending'";
@@ -739,8 +740,10 @@ class XnetGrpModule extends PLModule
         if (!empty($prenom)) {
             $where .= " AND prenom LIKE '%$prenom%'";
         }
-        if (is_numeric(Env::v('promo'))) {
+        if (preg_match('/^[0-9]{4}$/', Env::v('promo'))) {
             $where .= " AND promo = " . Env::i('promo');
+        } elseif (Env::has('promo')) {
+            return;
         }
         $res = XDB::iterator("SELECT user_id, nom, prenom, promo
                                 FROM auth_user_md5