Index: trunk/include/functions.inc.php
===================================================================
--- trunk/include/functions.inc.php	(revision 25549)
+++ trunk/include/functions.inc.php	(revision 25550)
@@ -104,10 +104,17 @@
 }
 
+/** no option for mkgetdir() */
 define('MKGETDIR_NONE', 0);
+/** sets mkgetdir() recursive */
 define('MKGETDIR_RECURSIVE', 1);
+/** sets mkgetdir() exit script on error */
 define('MKGETDIR_DIE_ON_ERROR', 2);
+/** sets mkgetdir() add a index.htm file */
 define('MKGETDIR_PROTECT_INDEX', 4);
+/** sets mkgetdir() add a .htaccess file*/
 define('MKGETDIR_PROTECT_HTACCESS', 8);
-define('MKGETDIR_DEFAULT', 7);
+/** default options for mkgetdir() = MKGETDIR_RECURSIVE | MKGETDIR_DIE_ON_ERROR | MKGETDIR_PROTECT_INDEX */
+define('MKGETDIR_DEFAULT', MKGETDIR_RECURSIVE | MKGETDIR_DIE_ON_ERROR | MKGETDIR_PROTECT_INDEX);
+
 /**
  * creates directory if not exists and ensures that directory is writable
Index: trunk/include/functions_mail.inc.php
===================================================================
--- trunk/include/functions_mail.inc.php	(revision 25549)
+++ trunk/include/functions_mail.inc.php	(revision 25550)
@@ -23,5 +23,11 @@
 
 /**
+ * @package functions\mail
+ */
+
+
+/**
  * Returns the name of the mail sender
+ *
  * @return string
  */
@@ -35,4 +41,5 @@
 /**
  * Returns the email of the mail sender
+ *
  * @since 2.6
  * @return string
@@ -46,5 +53,5 @@
 
 /**
- * Returns an array of mail configuration parameters :
+ * Returns an array of mail configuration parameters.
  * - send_bcc_mail_webmaster
  * - mail_allow_html
@@ -80,7 +87,12 @@
 
 /**
- * Returns an email address with an associated real name
- * @param string name
- * @param string email
+ * Returns an email address with an associated real name.
+ * Can return either:
+ *    - email@domain.com
+ *    - name <email@domain.com>
+ *
+ * @param string $name
+ * @param string $email
+ * @return string
  */
 function format_email($name, $email)
@@ -105,8 +117,9 @@
 
 /**
- * Returns the mail and the name from a formatted address
+ * Returns the email and the name from a formatted address.
  * @since 2.6
- * @param string|array $input
- * @return array
+ *
+ * @param string|string[] $input - if is an array must contain email[, name]
+ * @return array email, name
  */
 function unformat_email($input)
@@ -138,8 +151,10 @@
 
 /**
- * Return a clean array of hashmaps (email, name) from various inputs
- * - comma separated list
- * - array of emails
- * - single hashmap (email[, name])
+ * Return a clean array of hashmaps (email, name) removing duplicates.
+ * It accepts various inputs:
+ *    - comma separated list
+ *    - array of emails
+ *    - single hashmap (email[, name])
+ *    - array of incomplete hashmaps
  * @since 2.6
  *
@@ -164,5 +179,5 @@
         {
           $item = array(
-            'email' => $item,
+            'email' => trim($item),
             'name' => '',
             );
@@ -185,10 +200,25 @@
     $data = array_map('unformat_email', $data);
   }
-  
-  return $data;
-}
-
-/**
- * Returns an email address list with minimal email string
+
+  $existing = array();
+  foreach ($data as $i => $entry)
+  {
+    if (isset($existing[ $entry['email'] ])
+    {
+      unset($data[$i]);
+    }
+    else
+    {
+      $existing[ $entry['email'] ] = true;
+    }
+  }
+
+  return array_values($data);
+}
+
+/**
+ * Returns an email address list with minimal email string.
+ * @deprecated 2.6
+ *
  * @param string $email_list - comma separated
  * @return string
@@ -212,5 +242,6 @@
 
 /**
- * Return an new mail template
+ * Return an new mail template.
+ *
  * @param string $email_format - text/html or text/plain
  * @return Template
@@ -223,6 +254,7 @@
 
 /**
- * Return string email format (text/html or text/plain)
- * @param bool is_html
+ * Return string email format (text/html or text/plain).
+ *
+ * @param bool $is_html
  * @return string
  */
@@ -233,6 +265,7 @@
 
 /**
- * Switch language to specified language
+ * Switch language to specified language.
  * All entries are push on language stack
+ *
  * @param string $language
  */
@@ -296,5 +329,6 @@
 
 /**
- * Switch back language pushed with switch_lang_to function
+ * Switch back language pushed with switch_lang_to() function.
+ * @see switch_lang_to()
  */
 function switch_lang_back()
@@ -318,6 +352,7 @@
 
 /**
- * Send a notification email to all administrators
+ * Send a notification email to all administrators.
  * current user (if admin) is not notified
+ *
  * @param string|array $subject
  * @param string|array $content
@@ -376,5 +411,5 @@
 
 /**
- * Send a email to all administrators
+ * Send a email to all administrators.
  * current user (if admin) is excluded
  * @see pwg_mail()
@@ -425,10 +460,10 @@
 
 /**
- * Send an email to a group
+ * Send an email to a group.
  * @see pwg_mail()
  *
  * @param int $group_id
  * @param array $args - as in pwg_mail()
- *    @option string language_selected - filters users of the group by language
+ *       o language_selected: filters users of the group by language [default value empty]
  * @param array $tpl - as in pwg_mail()
  * @return boolean
@@ -509,7 +544,7 @@
 
 /**
- * sends an email, using Piwigo specific informations
- *
- * @param string|string[] $to
+ * Sends an email, using Piwigo specific informations.
+ *
+ * @param string|array $to
  * @param array $args
  *       o from: sender [default value webmaster email]
@@ -594,5 +629,8 @@
   if ($conf_mail['send_bcc_mail_webmaster'])
   {
-    $Bcc[] = get_webmaster_mail_address();
+    $Bcc[] = array(
+      'email' => get_webmaster_mail_address(),
+      'name' => '',
+      );
   }
   if (!empty($Bcc))
@@ -822,5 +860,5 @@
   {
     $ret = $mail->send();
-    if (!$ret and (!ini_get('display_errors') || is_admin()))
+    if (!$ret and (!ini_get('display_errors') or is_admin()))
     {
       trigger_error('Mailer Error: ' . $mail->ErrorInfo, E_USER_WARNING);
@@ -859,7 +897,8 @@
 
 /**
- * Moves CSS rules contained in the <style> tag to inline CSS
- * (for compatibility with Gmail and such clients)
+ * Moves CSS rules contained in the <style> tag to inline CSS.
+ * Used for compatibility with Gmail and such clients
  * @since 2.6
+ *
  * @param string $content
  * @return string
@@ -875,10 +914,9 @@
 
 /**
- * Saves a copy of the mail if _data/tmp
- * @param boolean $result
- * @param string $to
+ * Saves a copy of the mail if _data/tmp.
+ *
+ * @param boolean $success
+ * @param PHPMailer $mail
  * @param array $args
- * @param PHPMailer $mail
- * @return boolean $result
  */
 function pwg_send_mail_test($success, $mail, $args)
Index: trunk/include/functions_metadata.inc.php
===================================================================
--- trunk/include/functions_metadata.inc.php	(revision 25549)
+++ trunk/include/functions_metadata.inc.php	(revision 25550)
@@ -23,8 +23,13 @@
 
 /**
- * returns informations from IPTC metadata, mapping is done at the beginning
- * of the function
+ * @package functions\metadata
+ */
+
+
+/**
+ * returns informations from IPTC metadata, mapping is done in this function.
  *
  * @param string $filename
+ * @param array $map
  * @return array
  */
@@ -81,7 +86,7 @@
 
 /**
- * return a cleaned IPTC value
+ * return a cleaned IPTC value.
  *
- * @param string value
+ * @param string $value
  * @return string
  */
@@ -128,8 +133,8 @@
 
 /**
- * returns informations from EXIF metadata, mapping is done at the beginning
- * of the function
+ * returns informations from EXIF metadata, mapping is done in this function.
  *
  * @param string $filename
+ * @param array $map
  * @return array
  */
@@ -181,3 +186,4 @@
   return $result;
 }
+
 ?>
Index: trunk/include/functions_picture.inc.php
===================================================================
--- trunk/include/functions_picture.inc.php	(revision 25549)
+++ trunk/include/functions_picture.inc.php	(revision 25550)
@@ -22,11 +22,16 @@
 // +-----------------------------------------------------------------------+
 
+/**
+ * @package functions\picture
+ */
 
-/*
- * get slideshow default params into array
+
+/**
+ * Returns slideshow default params.
+ * - period
+ * - repeat
+ * - play
  *
- * @param void
- *
- * @return slideshow default values into array
+ * @return array
  */
 function get_default_slideshow_params()
@@ -41,12 +46,11 @@
 }
 
-/*
- * check and correct slideshow params from array
+/**
+ * Checks and corrects slideshow params
  *
- * @param array of params
- *
- * @return slideshow corrected values into array
+ * @param array $params
+ * @return array
  */
-function correct_slideshow_params($params = array())
+function correct_slideshow_params($params=array())
 {
   global $conf;
@@ -64,12 +68,11 @@
 }
 
-/*
- * Decode slideshow string params into array
+/**
+ * Decodes slideshow string params into array
  *
- * @param string params like ""
- *
- * @return slideshow values into array
+ * @param string $encode_params
+ * @return array
  */
-function decode_slideshow_params($encode_params = null)
+function decode_slideshow_params($encode_params=null)
 {
   global $conf;
@@ -106,12 +109,11 @@
 }
 
-/*
- * Encode slideshow array params into array
+/**
+ * Encodes slideshow array params into a string
  *
- * @param array params
- *
- * @return slideshow values into string
+ * @param array $decode_params
+ * @return string
  */
-function encode_slideshow_params($decode_params = array())
+function encode_slideshow_params($decode_params=array())
 {
   global $conf;
@@ -128,3 +130,4 @@
   return $result;
 }
+
 ?>
