Index: extensions/NBC_UserAdvManager/branches/2.12/admin/UserAdvManager_admin.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/admin/UserAdvManager_admin.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/admin/UserAdvManager_admin.php	(revision 4317)
@@ -45,4 +45,12 @@
 $error = array();
 $UserAdvManager_Password_Test_Score = 0;
+$pattern = '/;/';
+$replacement = '.';
+
+$UserAdvManager_MailInfo_Error_Txt = false;
+$UserAdvManager_ConfirmMail_Error_Txt = false;
+$UserAdvManager_Reminder_Error_Txt = false;
+$UserAdvManager_ConfirmMail_Error_Txt1 = false;
+$UserAdvManager_ConfirmMail_Error_Txt2 = false;
 
 // +-----------------------------------------------------------------------+
@@ -60,9 +68,35 @@
 	
 	if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) and isset($_POST['UserAdvManager_Password_Enforced']) and isset($_POST['UserAdvManager_AdminPassword_Enforced']) and isset($_POST['UserAdvManager_GhostUser_Tracker']))
-  {
+  { 
 		$_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text']));
+    
 		$_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
 
-  $_POST['UserAdvManager_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_GhostTracker_ReminderText']));
+    $_POST['UserAdvManager_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_GhostTracker_ReminderText']));
+
+
+/* Control of semicolons - Replaced by dots - Warning message is displayed */    
+    if ((preg_match($pattern, $_POST['UserAdvManager_MailInfo_Text'])) or (preg_match($pattern, $_POST['UserAdvManager_GhostTracker_ReminderText'])) or (preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_Text'])))
+    {
+      if (preg_match($pattern, $_POST['UserAdvManager_MailInfo_Text']))
+      {
+        $_POST['UserAdvManager_MailInfo_Text'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_MailInfo_Text']);
+        $UserAdvManager_MailInfo_Error_Txt = true;
+      }
+      
+      if (preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_Text']))
+      {
+        $_POST['UserAdvManager_ConfirmMail_Text'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_ConfirmMail_Text']);
+        $UserAdvManager_ConfirmMail_Error_Txt = true;
+      }
+      
+      if (preg_match($pattern, $_POST['UserAdvManager_GhostTracker_ReminderText']))
+      {
+        $_POST['UserAdvManager_GhostTracker_ReminderText'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_GhostTracker_ReminderText']);
+        $UserAdvManager_Reminder_Error_Txt = true;
+      }
+      
+      array_push($page['errors'], l10n('mail_text_error'));
+    }
 		
 		$newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'].';'.$_POST['UserAdvManager_GhostUser_Tracker'].';'.$_POST['UserAdvManager_GhostTracker_DayLimit'].';'.$_POST['UserAdvManager_GhostTracker_ReminderText'];
@@ -107,5 +141,5 @@
   $result = pwg_query($query);
 	
-  while ($row = mysql_fetch_array($result))
+  while ($row = mysql_fetch_assoc($result))
   {
     $groups[$row['id']] = $row['name'];
@@ -214,4 +248,7 @@
     'UserAdvManager_GHOSTRACKER_REMINDERTEXT' => $conf_nbc_UserAdvManager[19],
 		'UserAdvManager_PASSWORD_TEST_SCORE'      => $UserAdvManager_Password_Test_Score,
+    'UserAdvManager_ERROR_REPORTS1'           => $UserAdvManager_MailInfo_Error_Txt,
+    'UserAdvManager_ERROR_REPORTS2'           => $UserAdvManager_ConfirmMail_Error_Txt,
+    'UserAdvManager_ERROR_REPORTS3'           => $UserAdvManager_Reminder_Error_Txt,
     )
   );
@@ -238,7 +275,7 @@
 		  $result = pwg_query($query);
 			
-		  while($row = mysql_fetch_array($result))
+		  while($row = mysql_fetch_assoc($result))
 	  	{
-				$msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').$row['username'];
+				$msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').stripslashes($row['username']);
 			}
 		}
@@ -256,8 +293,8 @@
 			$result = pwg_query($query);
 			
-			while($row = mysql_fetch_array($result))
+			while($row = mysql_fetch_assoc($result))
 			{
-				if (!ValidateUsername($row['username']))
-					$msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').$row['username'];
+				if (!ValidateUsername(stripslashes($row['username'])))
+					$msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').stripslashes($row['username']);
 			}
 		}
@@ -275,5 +312,5 @@
 		  $result = pwg_query($query);
 			
-		  while($row = mysql_fetch_array($result))
+		  while($row = mysql_fetch_assoc($result))
 		  {
 				$conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
@@ -284,5 +321,5 @@
 				  if (preg_match($pattern, $row['mail_address']))
 				  {
-						$msg_error3 .=  (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').$row['username'].' ('.$row['mail_address'].')';
+						$msg_error3 .=  (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').stripslashes($row['username']).' ('.$row['mail_address'].')';
 					}
 				}
@@ -340,5 +377,25 @@
 		{
 	  	$_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1']));
+
 	  	$_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']));
+
+/* Control of semicolons - Replaced by dots - Warning message displayed */
+    if ((preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'])) or (preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'])))
+    {
+      if ((preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'])))
+      {
+        $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1']);
+        $UserAdvManager_ConfirmMail_Error_Txt1 = true;
+      }
+      
+      if ((preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'])))
+      {
+        $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']);
+        
+        $UserAdvManager_ConfirmMail_Error_Txt2 = true;
+      }
+      
+      array_push($page['errors'], l10n('mail_text_error'));
+    }
    		  
 	  	$newconf_nbc_UserAdvManager_ConfirmMail = $_POST['UserAdvManager_ConfirmMail_TimeOut'].';'.$_POST['UserAdvManager_ConfirmMail_Delay'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'].';'.$_POST['UserAdvManager_ConfirmMail_Remail'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'];
@@ -371,4 +428,6 @@
     'UserAdvManager_CONFIRMMAIL_REMAIL_TXT1'		=> $conf_nbc_UserAdvManager_ConfirmMail[2],
     'UserAdvManager_CONFIRMMAIL_REMAIL_TXT2'		=> $conf_nbc_UserAdvManager_ConfirmMail[4],
+    'UserAdvManager_ERROR_REPORTS1'             => $UserAdvManager_ConfirmMail_Error_Txt1,
+    'UserAdvManager_ERROR_REPORTS2'             => $UserAdvManager_ConfirmMail_Error_Txt2,
     	)
 	  );		
@@ -588,7 +647,7 @@
 WHERE id = '".$user_id."'
 ;";
-					$data = mysql_fetch_array(pwg_query($query));
+					$data = mysql_fetch_assoc(pwg_query($query));
 				
-      		ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],true);
+      		ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],true);
       	}
       	array_push(
@@ -673,7 +732,7 @@
 ;";
 					
-					$data = mysql_fetch_array(pwg_query($query));
+					$data = mysql_fetch_assoc(pwg_query($query));
 				
-      		ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],false);				
+      		ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],false);				
       	}
       	array_push(
@@ -757,5 +816,5 @@
 ;";
 					
-					$data = mysql_fetch_array(pwg_query($query));
+					$data = mysql_fetch_assoc(pwg_query($query));
 				
       		ForceValidation($data['id']);				
@@ -788,5 +847,5 @@
 		$result = pwg_query($query);
           
-    while ($row = mysql_fetch_array($result))
+    while ($row = mysql_fetch_assoc($result))
     {
       $groups[$row['id']] = $row['name'];
@@ -884,5 +943,5 @@
          	'U_PROFILE' => $profile_url.$local_user['id'],
          	'U_PERM' => $perm_url.$local_user['id'],
-         	'USERNAME' => $local_user['username']
+         	'USERNAME' => stripslashes($local_user['username'])
 						.($local_user['id'] == $conf['guest_id']
 						? '<BR />['.l10n('is_the_guest').']' : '')
@@ -1112,7 +1171,7 @@
 ;";
 					
-					$data = mysql_fetch_array(pwg_query($query));
+					$data = mysql_fetch_assoc(pwg_query($query));
 				
-      		ghostreminder($user_id,$data['username'],$data['mail_address']);				
+      		ghostreminder($user_id,stripslashes($data['username']),$data['mail_address']);				
       	}
       	array_push(
@@ -1156,5 +1215,5 @@
           $result = pwg_query($query);
           
-          while ($row = mysql_fetch_array($result))
+          while ($row = mysql_fetch_assoc($result))
           {
             list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
@@ -1183,5 +1242,5 @@
           $result = pwg_query($query);
           
-          while($row = mysql_fetch_array($result))
+          while($row = mysql_fetch_assoc($result))
           {
             list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
@@ -1276,5 +1335,5 @@
        		'ID' => $local_user['id'],
          	'CHECKED' => $checked,
-         	'USERNAME' => $local_user['username']
+         	'USERNAME' => stripslashes($local_user['username'])
 						.($local_user['id'] == $conf['guest_id']
 						? '<BR />['.l10n('is_the_guest').']' : '')
Index: extensions/NBC_UserAdvManager/branches/2.12/admin/confirmmail.tpl
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/admin/confirmmail.tpl	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/admin/confirmmail.tpl	(revision 4317)
@@ -21,16 +21,30 @@
     
 {if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE}
+  {if $UserAdvManager_ERROR_REPORTS1}
+		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
+	  </li>
+  {else}
 		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br>
 		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
 	  </li>
-		
-    <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
-		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
-	  </li>
+  {/if}
 {else}
 		<li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br>
 		<textarea  name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" readonly{$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br>
 	  </li>
-		
+{/if}
+
+{if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE}
+  {if $UserAdvManager_ERROR_REPORTS2}
+    <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
+	  </li>
+  {else}		
+    <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
+		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
+	  </li>
+  {/if}
+{else}
     <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br>
 		<textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br>
Index: extensions/NBC_UserAdvManager/branches/2.12/admin/global.tpl
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/admin/global.tpl	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/admin/global.tpl	(revision 4317)
@@ -69,7 +69,13 @@
       
 {if $UserAdvManager_GHOSTRACKER_TRUE}
+  {if $UserAdvManager_ERROR_REPORTS3}
+    	<li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br>
+        <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
+    	</li>
+  {else}
     	<li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br>
         <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br>
     	</li>
+  {/if}
 {else}
     	<li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br>
@@ -90,8 +96,14 @@
     	</li>
 
-{if $UserAdvManager_MAIL_INFO_TRUE}      
+{if $UserAdvManager_MAIL_INFO_TRUE}
+  {if $UserAdvManager_ERROR_REPORTS1}      
+    	<li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
+        <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" style="color: red"  {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br>
+    	</li>
+  {else}
     	<li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
         <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br>
     	</li>
+  {/if}
 {else}
     	<li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
@@ -105,8 +117,14 @@
     	</li>
 
-{if $UserAdvManager_CONFIRM_MAIL_TRUE}     
+{if $UserAdvManager_CONFIRM_MAIL_TRUE}
+  {if $UserAdvManager_ERROR_REPORTS2}     
+    	<li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
+        <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br>
+    	</li>
+  {else}
     	<li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
         <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br>
     	</li>
+  {/if}
 {else}
     	<li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
Index: extensions/NBC_UserAdvManager/branches/2.12/include/functions_UserAdvManager.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/include/functions_UserAdvManager.inc.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/include/functions_UserAdvManager.inc.php	(revision 4317)
@@ -18,14 +18,20 @@
   {
     case 1:
-      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Add of %s', $username));
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Add of %s', stripslashes($username)));
       $password = $password <> '' ? $password : l10n('UserAdvManager_empty_pwd');
       
-      if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[10]) and $conf_nbc_UserAdvManager[10] <> '')
-        $infos1_perso = get_user_language_desc($conf_nbc_UserAdvManager[10])."\n\n";
+      if (isset($conf_nbc_UserAdvManager[10]) and $conf_nbc_UserAdvManager[10] <> '')
+      {
+        if (function_exists('get_user_language_desc'))
+        {
+          $infos1_perso = get_user_language_desc($conf_nbc_UserAdvManager[10])."\n\n";
+        }
+        else $infos1_perso = l10n($conf_nbc_UserAdvManager[10])."\n\n"; 
+      }
       
       break;
       
     case 2:
-      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username)));
       $password = $password <> '' ? $password : l10n('UserAdvManager_empty_pwd');
 
@@ -33,5 +39,5 @@
         
     case 3:
-      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username)));
       $password = $password <> '' ? $password : l10n('UserAdvManager_no_update_pwd');
 
@@ -42,6 +48,6 @@
   {
     $infos1 = array(
-      get_l10n_args('infos_mail %s', $username),
-      get_l10n_args('User: %s', $username),
+      get_l10n_args('infos_mail %s', stripslashes($username)),
+      get_l10n_args('User: %s', stripslashes($username)),
       get_l10n_args('Password: %s', $password),
       get_l10n_args('Email: %s', $email),
@@ -59,6 +65,12 @@
     );
 
-    if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[11]) and $conf_nbc_UserAdvManager[11] <> '')
-      $infos2_perso = get_user_language_desc($conf_nbc_UserAdvManager[11])."\n\n";
+    if (isset($conf_nbc_UserAdvManager[11]) and $conf_nbc_UserAdvManager[11] <> '')
+    {
+      if (function_exists('get_user_language_desc'))
+      {
+        $infos2_perso = get_user_language_desc($conf_nbc_UserAdvManager[11])."\n\n";
+      }
+      else $infos2_perso = l10n($conf_nbc_UserAdvManager[11])."\n\n";
+    }
   }
 
@@ -108,25 +120,36 @@
       $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_with_key_of_%s', $username));
       
-      if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm)
+      if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm)
       {
-				$infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
-			
-				$infos2 = array
-				(
-					get_l10n_args('Link: %s', ResetConfirmMail($user_id)),
-					get_l10n_args('', ''),
-				);
+        if (function_exists('get_user_language_desc'))
+        {
+          $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+        }
+				else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+
+        $infos2 = array
+        (
+          get_l10n_args('Link: %s', ResetConfirmMail($user_id)),
+          get_l10n_args('', ''),
+        );        
 			}
+      
 		break;
       
     case 2:
-      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s', $username));
-      
-      if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm)
+      $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s',$username));
+      
+      if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm)
       {
-				$infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+        if (function_exists('get_user_language_desc'))
+        {
+          $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";
+        }
+        else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n";				
       }
+      
     break;
 	}
+  
   pwg_mail($email, array(
     'subject' => $subject,
@@ -157,7 +180,12 @@
   $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Ghost_remainder_of_%s', $username));
       
-  if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[19]) and $conf_nbc_UserAdvManager[19] <> '' and isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true')
-  {
-    $infos1 = get_user_language_desc($conf_nbc_UserAdvManager[19])."\n\n";
+  if (isset($conf_nbc_UserAdvManager[19]) and $conf_nbc_UserAdvManager[19] <> '' and isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true')
+  {
+    if (function_exists('get_user_language_desc'))
+    {
+      $infos1 = get_user_language_desc($conf_nbc_UserAdvManager[19])."\n\n";
+    }
+    else $infos1 = l10n($conf_nbc_UserAdvManager[19])."\n\n";
+    
     resetlastvisit($user_id);
   }
@@ -351,5 +379,5 @@
 WHERE id = '".$id."'
 ;";
-    $data = mysql_fetch_array(pwg_query($query));
+    $data = mysql_fetch_assoc(pwg_query($query));
         
     if (!empty($data) and isset($data['user_id']) and !isset($data['date_check']))
@@ -517,5 +545,5 @@
 WHERE user_id = '".$id."'
 ;";
-    $data = mysql_fetch_array(pwg_query($query));
+    $data = mysql_fetch_assoc(pwg_query($query));
 
     if (!empty($data) and isset($data['user_id']) and !isset($data['date_check']))
@@ -588,5 +616,5 @@
     list($username) = mysql_fetch_row(pwg_query($query));
 
-    return isset($username) ? $username : '';
+    return isset($username) ? stripslashes($username) : '';
   }
 }
@@ -616,4 +644,5 @@
 
 /* Function called from main.inc.php - Check if user's email is in excluded email providers list */
+/* Doesn't work on call - Must be copied in main.inc.php to work */
 function ValidateEmailProvider($email)
 {
@@ -629,7 +658,11 @@
 			$pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
 			if (preg_match($pattern, $ncsemail))
+      {
         		return false;
-        	else
+      }
+      else
+      {
       			return true;
+      }
 		}
 	}
@@ -690,5 +723,5 @@
 	$result = pwg_query($query);
       
-  while ($row = mysql_fetch_array($result))
+  while ($row = mysql_fetch_assoc($result))
   {
   	$user = $row;
@@ -717,5 +750,5 @@
 		$result = pwg_query($query);
         
-    while ($row = mysql_fetch_array($result))
+    while ($row = mysql_fetch_assoc($result))
     {
     	array_push(
@@ -755,5 +788,5 @@
 	$result = pwg_query($query);
       
-  while ($row = mysql_fetch_array($result))
+  while ($row = mysql_fetch_assoc($result))
   {
   	$user = $row;
Index: extensions/NBC_UserAdvManager/branches/2.12/language/de_DE/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/language/de_DE/plugin.lang.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/language/de_DE/plugin.lang.php	(revision 4317)
@@ -172,4 +172,7 @@
 $lang['GhostTracker_Init_OK'] = 'Geist Tracker neu gehstellt !';
 // --------- End: New or revised $lang ---- from version 2.12.2
+// --------- Starting below: New or revised $lang ---- from version 2.12.7
+/* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
+// --------- End: New or revised $lang ---- from version 2.12.7
 
 
Index: extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/plugin.lang.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/plugin.lang.php	(revision 4317)
@@ -173,4 +173,7 @@
 $lang['GhostTracker_Init_OK'] = 'Ghost Tracker reset done !';
 // --------- End: New or revised $lang ---- from version 2.12.2
+// --------- Starting below: New or revised $lang ---- from version 2.12.7
+$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
+// --------- End: New or revised $lang ---- from version 2.12.7
 
 
Index: extensions/NBC_UserAdvManager/branches/2.12/language/es_ES/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/language/es_ES/plugin.lang.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/language/es_ES/plugin.lang.php	(revision 4317)
@@ -173,4 +173,7 @@
 $lang['GhostTracker_Init_OK'] = '¡Ghost Tracker restablecer hecho!';
 // --------- End: New or revised $lang ---- from version 2.12.2
+// --------- Starting below: New or revised $lang ---- from version 2.12.7
+/* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
+// --------- End: New or revised $lang ---- from version 2.12.7
 
 
Index: extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/plugin.lang.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/plugin.lang.php	(revision 4317)
@@ -172,4 +172,7 @@
 $lang['GhostTracker_Init_OK'] = 'Initialisation Ghost Tracker effectuée !';
 // --------- End: New or revised $lang ---- from version 2.12.2
+// --------- Starting below: New or revised $lang ---- from version 2.12.7
+$lang['mail_text_error'] = '<b>Attention!</b> - Le point-virgule (;) n\'est pas autorisé dans le texte additionnel des emails. Ce caractère a été automatiquement remplacé par un point (.). Pour information, le(s) texte(s) modifié(s) est(sont) affiché(s) en rouge dans le(s) champ(s) correspondant(s). Veuillez le(s) vérifier.';
+// --------- End: New or revised $lang ---- from version 2.12.7
 
 
Index: extensions/NBC_UserAdvManager/branches/2.12/language/it_IT/plugin.lang.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/language/it_IT/plugin.lang.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/language/it_IT/plugin.lang.php	(revision 4317)
@@ -173,4 +173,7 @@
 /* TODO */$lang['GhostTracker_Init_OK'] = 'Ghost Tracker reset done !';
 // --------- End: New or revised $lang ---- from version 2.12.2
+// --------- Starting below: New or revised $lang ---- from version 2.12.7
+/* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.';
+// --------- End: New or revised $lang ---- from version 2.12.7
 
 
Index: extensions/NBC_UserAdvManager/branches/2.12/main.inc.php
===================================================================
--- extensions/NBC_UserAdvManager/branches/2.12/main.inc.php	(revision 4316)
+++ extensions/NBC_UserAdvManager/branches/2.12/main.inc.php	(revision 4317)
@@ -2,5 +2,5 @@
 /*
 Plugin Name: NBC UserAdvManager
-Version: 2.12.6
+Version: 2.12.7
 Description: Renforcer les possibilités de gestion des utilisateurs - Enforce users management
 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
@@ -99,4 +99,10 @@
 -- 2.12.6 : Bug 1236 fixed -  Admins was unable to add a new user in the user_list page.
             Beginning of IT translations
+            
+-- 2.12.7 : Bug 1238 fixed - Simple custom email text wasn't send when Extended Description plugin wasn't set
+            Bug 1245 fixed - Semicolons (;) are no longer allowed in text areas (mail info text, ConfirmMail text, reminder text,...). They'll be replaced by dots (.).
+            Bug 1248 fixed - Php notice on user registration with a forbidden email domain
+            Bug 1250 fixed - Email provider didn't work after the third exclusion in list
+            Escaping all special characters typed in login name and recover them
 */
 
@@ -286,32 +292,5 @@
 from '.USERS_TABLE.'
 where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\');';
-      list($count) = mysql_fetch_array(pwg_query($query));
-      if ($count != 0)
-      {
-        return l10n('reg_err_mail_address_dbl');
-      }
-    }
-  }
-  else
-  {
-    /* ***************************** */
-    /* Standard Piwigo's email check */
-    /* ***************************** */
-    $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
-    $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
-    $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
-
-    if (!preg_match($regex, $_POST['mail_address']))
-    {
-      return l10n('reg_err_mail_address');
-    }
-    
-    if (!empty($_POST['mail_address']))
-    {
-      $query = '
-select count(*)
-from '.USERS_TABLE.'
-where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\');';
-      list($count) = mysql_fetch_array(pwg_query($query));
+      list($count) = mysql_fetch_assoc(pwg_query($query));
       if ($count != 0)
       {
@@ -372,9 +351,25 @@
 
   /* Email without forbidden domains */
-  if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
-  {
-    //$_POST['mail_address'] = '';
-    return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-  }
+  /* This doesn't work */
+//  if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
+//  {
+//    $_POST['mail_address'] = '';
+//    return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+//  }
+  /* This work with a code copy of ValidateEmailProvider() function */
+  if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+  {
+    $ncsemail = strtolower($_POST['mail_address']);
+    $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
+    for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+    {
+      $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+      if (preg_match($pattern, $ncsemail))
+      {
+        $_POST['mail_address'] = '';    			 
+        return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+      }
+    }
+	}  
 }
 
@@ -393,12 +388,28 @@
     {
       /* Email without forbidden domains */
-      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
-      {
-        if (!ValidateEmailProvider($_POST['mail_address']))
+      /* This doesn't work */
+//      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
+//      {
+//        if (!ValidateEmailProvider($_POST['mail_address']))
+//        {
+//          $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+//          unset($_POST['validate']);
+//        }
+//      }
+        /* This work with a code copy of ValidateEmailProvider() function */
+        if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
         {
-          $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-          unset($_POST['validate']);
+          $ncsemail = strtolower($_POST['mail_address']);
+          $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
+          for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+          {
+            $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+            if (preg_match($pattern, $ncsemail))
+            {    			 
+              $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+              unset($_POST['validate']);
+            }
+          }
         }
-      }
 
       $typemail = 3;
@@ -424,9 +435,9 @@
       
       /* Sending registration confirmation by email */
-      if (( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
+      if ((isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
       {
         $confirm_mail_need = false;
               
-        if (!empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']))
+        if (!empty($_POST['mail_address']))
         {
           $query = '
@@ -438,10 +449,10 @@
           list($current_email) = mysql_fetch_row(pwg_query($query));
       
-          if ( $_POST['mail_address'] != $current_email and ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true') )
+          if ($_POST['mail_address'] != $current_email and ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
         
             $confirm_mail_need = true;
         }
         
-        if ((!empty($_POST['use_new_pwd']) and ( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or $confirm_mail_need) )
+        if ((!empty($_POST['use_new_pwd']) and (isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or $confirm_mail_need))
         {
           $query = '
@@ -513,8 +524,24 @@
 
       /* Email without forbidden domains */
-      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
-      {
-        $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
-        unset($_POST['submit_add']);
+      /* This doesn't work */
+//      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
+//      {
+//        $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+//        unset($_POST['submit_add']);
+//      }
+      /* This work with a code copy of ValidateEmailProvider() function */
+      if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']))
+      {
+        $ncsemail = strtolower($_POST['email']);
+        $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
+        for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
+        {
+          $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
+          if (preg_match($pattern, $ncsemail))
+          {    			 
+            $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'");
+            unset($_POST['submit_add']);
+          }
+        }
       }
     }
