diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 73b43e95f4b..5c9e27d5420 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -180,10 +180,45 @@ tools: - 'htdocs/includes/*' paths: { } + php_changetracking: + enabled: false + bug_patterns: + - '\bfix(?:es|ed)?\b' + feature_patterns: + - '\badd(?:s|ed)?\b' + - '\bimplement(?:s|ed)?\b' + filter: + excluded_paths: + - 'build/*' + - 'dev/*' + - 'doc/*' + - 'test/*' + - 'htdocs/includes/*' + paths: { } + # Coding-Style / Bug Detection - js_hint: false + js_hint: + enabled: false + use_native_config: true + extensions: + - js + filter: + excluded_paths: + - 'build/*' + - 'dev/*' + - 'doc/*' + - 'test/*' + - 'htdocs/includes/*' + paths: { } + config: { } + path_configs: { } +checks: + php: + code_rating: true + duplication: true + before_commands: { } after_commands: { } artifacts: { } diff --git a/dev/skeletons/skeleton_class.class.php b/dev/skeletons/skeleton_class.class.php index f623debc581..4dddc5a8c80 100644 --- a/dev/skeletons/skeleton_class.class.php +++ b/dev/skeletons/skeleton_class.class.php @@ -182,7 +182,7 @@ class Skeleton_Class extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 6a337766ff3..5af59689c18 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -107,7 +107,7 @@ class Categorie extends CommonObject $this->type = $res['type']; $this->entity = $res['entity']; - $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals($this->id,null); $this->db->free($resql); @@ -202,7 +202,7 @@ class Categorie extends CommonObject // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('HookModuleNamedao')); $parameters=array('socid'=>$this->id); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,'create'); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used @@ -294,7 +294,7 @@ class Categorie extends CommonObject // FIXME le hook fait double emploi avec le trigger !! $hookmanager->initHooks(array('HookCategorydao')); $parameters=array(); - $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,'update'); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used @@ -419,7 +419,7 @@ class Categorie extends CommonObject $error++; } } - + // Delete category if (! $error) { @@ -441,7 +441,7 @@ class Categorie extends CommonObject if ($result < 0) { $error++; - dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::delete erreur ".$this->error, LOG_ERR); } } } @@ -799,7 +799,7 @@ class Categorie extends CommonObject */ function get_full_arbo($type,$markafterid=0) { - global $langs; + global $conf, $langs; $this->cats = array(); @@ -809,11 +809,9 @@ class Categorie extends CommonObject // Init $this->cats array $sql = "SELECT DISTINCT c.rowid, c.label, c.description, c.fk_parent"; // Distinct reduce pb with old tables with duplicates - if (! empty($conf->global->MAIN_MULTILANGS)) - $sql.= ", t.label as label_trans, t.description as description_trans"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ", t.label as label_trans, t.description as description_trans"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie as c"; - if (! empty($conf->global->MAIN_MULTILANGS)) - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_lang as t ON t.fk_category=c.rowid AND t.lang='".$current_lang."'"; $sql.= " WHERE c.entity IN (".getEntity('category',1).")"; $sql.= " AND c.type = ".$type; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 15d85afec07..3de6b5ad075 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2118,7 +2118,7 @@ class Propal extends CommonObject if (! $error) { - dol_syslog(get_class($this)."::delete $this->id by $user->id", LOG_DEBUG); + dol_syslog(get_class($this)."::delete ".$this->id." by ".$user->id, LOG_DEBUG); $this->db->commit(); return 1; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e2a039cf2d8..26f9415e8a5 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1145,7 +1145,7 @@ class AccountLine extends CommonObject * @param User $user User object that delete * @return int <0 if KO, >0 if OK */ - function delete($user=0) + function delete($user=null) { $nbko=0; @@ -1194,7 +1194,7 @@ class AccountLine extends CommonObject * @param User $user User object that delete * @return int <0 if KO, >0 if OK */ - function delete_urls($user=0) + function delete_urls($user=null) { $nbko=0; diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index a1bc0191175..8811ad7c878 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -172,7 +172,7 @@ class BankCateg // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 605d4920669..e410ab49de2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1040,7 +1040,7 @@ class Facture extends CommonInvoice * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index cdc935cde01..b75bb056e03 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -261,7 +261,7 @@ class PaymentTerm // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 4174d693da3..e2c9c94595a 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -127,7 +127,7 @@ class Localtax extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 9aaa175f6f4..5e60b76ee13 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -73,7 +73,7 @@ class PaymentSalary extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; @@ -144,7 +144,7 @@ class PaymentSalary extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=0) + function fetch($id, $user=null) { global $langs; $sql = "SELECT"; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index fe2062e1ad7..395932de69f 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -220,7 +220,7 @@ class PaymentSocialContribution extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 5d0762d3e35..a86af28cace 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -143,7 +143,7 @@ class Tva extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; @@ -205,7 +205,7 @@ class Tva extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=0) + function fetch($id, $user=null) { global $langs; $sql = "SELECT"; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index a17c0ee1b44..cef881fca37 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -220,7 +220,7 @@ class Contact extends CommonObject * @param string $action Current action for hookmanager * @return int <0 if KO, >0 if OK */ - function update($id, $user=0, $notrigger=0, $action='update') + function update($id, $user=null, $notrigger=0, $action='update') { global $conf, $langs, $hookmanager; @@ -427,7 +427,7 @@ class Contact extends CommonObject * @param User $user User asking to change alert or birthday * @return int <0 if KO, >=0 if OK */ - function update_perso($id, $user=0) + function update_perso($id, $user=null) { $error=0; $result=false; @@ -492,7 +492,7 @@ class Contact extends CommonObject * @param User $user Utilisateur (abonnes aux alertes) qui veut les alertes de ce contact * @return int -1 if KO, 0 if OK but not found, 1 if OK */ - function fetch($id, $user=0) + function fetch($id, $user=null) { global $langs; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 5626719d96d..4abfb1f9c86 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -989,7 +989,7 @@ class Contrat extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index f2208a24d30..59980cea7a9 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -191,7 +191,7 @@ class Ccountry // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php index eea64ed10ac..027dda53dd3 100644 --- a/htdocs/core/class/ctypent.class.php +++ b/htdocs/core/class/ctypent.class.php @@ -198,7 +198,7 @@ class Ctypent // extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index e191773517b..299026a84bb 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -154,7 +154,7 @@ class Events // extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; @@ -191,7 +191,7 @@ class Events // extends CommonObject * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=0) + function fetch($id, $user=null) { global $langs; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index c1c760a29e7..30f5960e0ce 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -74,7 +74,7 @@ class Menubase * @param User $user User that create * @return int <0 if KO, Id of record if OK */ - function create($user=0) + function create($user=null) { global $conf, $langs; @@ -185,7 +185,7 @@ class Menubase * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; @@ -250,7 +250,7 @@ class Menubase * @param User $user User that load * @return int <0 if KO, >0 if OK */ - function fetch($id, $user=0) + function fetch($id, $user=null) { global $langs; diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 23313d27f13..aaa69ec7f42 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -96,7 +96,7 @@ class Cronjob extends CommonObject $error=0; $now=dol_now(); - + // Clean parameters if (isset($this->label)) $this->label=trim($this->label); @@ -501,7 +501,7 @@ class Cronjob extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index aae1e275d8f..6c0de13d15b 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -184,7 +184,7 @@ class EcmDirectory // extends CommonObject * @param int $notrigger 0=no, 1=yes (no update trigger) * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index bb34f480d97..2cc0667d58a 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -800,7 +800,7 @@ class Expedition extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index db4212308de..2de2d73e8ac 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -539,7 +539,7 @@ class FactureFournisseur extends CommonInvoice * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 5ff23b45ec0..5381c99df07 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -470,7 +470,7 @@ class Holiday extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index bcc1146c714..48119a7f16f 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -254,7 +254,7 @@ class Opensurveysondage extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/product/class/productbatch.class.php b/htdocs/product/class/productbatch.class.php index c124f9648e3..a4df7a95829 100644 --- a/htdocs/product/class/productbatch.class.php +++ b/htdocs/product/class/productbatch.class.php @@ -34,7 +34,7 @@ class Productbatch extends CommonObject private static $_table_element='product_batch'; //!< Name of table without prefix where object is stored var $id; - + var $tms=''; var $fk_product_stock; var $sellby=''; @@ -43,7 +43,7 @@ class Productbatch extends CommonObject var $qty; var $import_key; - + /** @@ -92,7 +92,7 @@ class Productbatch extends CommonObject $sql.= " ".(! isset($this->qty)?'NULL':$this->qty).","; $sql.= " ".(! isset($this->import_key)?'NULL':"'".$this->db->escape($this->import_key)."'").""; - + $sql.= ")"; $this->db->begin(); @@ -148,7 +148,7 @@ class Productbatch extends CommonObject global $langs; $sql = "SELECT"; $sql.= " t.rowid,"; - + $sql.= " t.tms,"; $sql.= " t.fk_product_stock,"; $sql.= " t.sellby,"; @@ -157,7 +157,7 @@ class Productbatch extends CommonObject $sql.= " t.qty,"; $sql.= " t.import_key"; - + $sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t"; $sql.= " WHERE t.rowid = ".$id; @@ -196,7 +196,7 @@ class Productbatch extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; @@ -376,7 +376,7 @@ class Productbatch extends CommonObject function initAsSpecimen() { $this->id=0; - + $this->tms=''; $this->fk_product_stock=''; $this->sellby=''; @@ -384,14 +384,14 @@ class Productbatch extends CommonObject $this->batch=''; $this->import_key=''; - + } /** * Clean fields (triming) * * @return void - */ + */ private function clean_param() { if (isset($this->fk_product_stock)) $this->fk_product_stock=(int) trim($this->fk_product_stock); if (isset($this->batch)) $this->batch=trim($this->batch); @@ -429,7 +429,7 @@ class Productbatch extends CommonObject if (! empty($batch_number)) $sql.= " AND batch = '".$this->db->escape($batch_number)."'"; if (! empty($where)) $sql.= " AND (".implode(" OR ",$where).")"; - + dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); if ($resql) @@ -439,7 +439,7 @@ class Productbatch extends CommonObject $obj = $this->db->fetch_object($resql); $this->id = $obj->rowid; - + $this->tms = $this->db->jdate($obj->tms); $this->fk_product_stock = $obj->fk_product_stock; $this->sellby = $this->db->jdate($obj->sellby); @@ -480,10 +480,10 @@ class Productbatch extends CommonObject $sql.= " t.qty,"; $sql.= " t.import_key"; - + $sql.= " FROM ".MAIN_DB_PREFIX.self::$_table_element." as t"; $sql.= " WHERE fk_product_stock=".$fk_product_stock; - + if ($with_qty) $sql.= " AND qty<>0"; dol_syslog("productbatch::findAll", LOG_DEBUG); $resql=$db->query($sql); diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index e3e6373962b..3e6219afb40 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -261,7 +261,7 @@ class Task extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; @@ -801,7 +801,7 @@ class Task extends CommonObject $this->db->rollback(); $ret = -2; } - + $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task_time"; $sql.= " SET thm = (SELECT thm FROM ".MAIN_DB_PREFIX."user WHERE rowid = ".$this->timespent_fk_user.")"; $sql.= " WHERE rowid = ".$tasktime_id; diff --git a/htdocs/resource/class/resource.class.php b/htdocs/resource/class/resource.class.php index 4beac635568..a7be5d0d25a 100644 --- a/htdocs/resource/class/resource.class.php +++ b/htdocs/resource/class/resource.class.php @@ -205,7 +205,7 @@ class Resource extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update($user=0, $notrigger=0) + function update($user=null, $notrigger=0) { global $conf, $langs; $error=0; @@ -695,7 +695,7 @@ class Resource extends CommonObject * @param int $notrigger 0=launch triggers after, 1=disable triggers * @return int <0 if KO, >0 if OK */ - function update_element_resource($user=0, $notrigger=0) + function update_element_resource($user=null, $notrigger=0) { global $conf, $langs; $error=0; diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index f08a4a2455c..7b36423cb61 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -232,7 +232,7 @@ class Address * @param User $user Objet de l'utilisateur * @return int >0 si ok, <0 si ko */ - function fetch_lines($socid, $user=0) + function fetch_lines($socid, $user=null) { global $langs, $conf; @@ -325,7 +325,7 @@ class Address * @param User $user Objet de l'utilisateur * @return int >0 si ok, <0 si ko */ - function fetch_address($id, $user=0) + function fetch_address($id, $user=null) { global $langs; global $conf;