';
diff --git a/htdocs/compta/export/modules/compta.export.class.php b/htdocs/compta/export/modules/compta.export.class.php
index ebe6ce4ab75..8a76251b1ee 100644
--- a/htdocs/compta/export/modules/compta.export.class.php
+++ b/htdocs/compta/export/modules/compta.export.class.php
@@ -178,7 +178,7 @@ class ComptaExport
$this->linep[$i][5] = $obj->amount;
$this->linep[$i][6] = $obj->libelle;
- if (strlen(trim( $obj->increment)) > 0)
+ if (dol_strlen(trim( $obj->increment)) > 0)
{
$this->linep[$i][7] = $obj->increment;
}
diff --git a/htdocs/compta/export/modules/compta.export.safran.class.php b/htdocs/compta/export/modules/compta.export.safran.class.php
index 006057c8865..7c1c5d284c5 100644
--- a/htdocs/compta/export/modules/compta.export.safran.class.php
+++ b/htdocs/compta/export/modules/compta.export.safran.class.php
@@ -47,7 +47,7 @@ class ComptaExportTableur extends ComptaExport
$fname = DOL_DATA_ROOT ."/telephonie/ligne/commande/".$this->datef.".xls";
- if (strlen(trim($this->fournisseur->email_commande)) == 0)
+ if (dol_strlen(trim($this->fournisseur->email_commande)) == 0)
{
return -3;
}
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 6b6112e7548..a6eb0799a1a 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1166,7 +1166,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
}
}
- if (strlen($sendto))
+ if (dol_strlen($sendto))
{
$langs->load("commercial");
@@ -1178,7 +1178,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
if ($_POST['action'] == 'send')
{
- if (strlen($_POST['subject'])) $subject = $_POST['subject'];
+ if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
else $subject = $langs->transnoentities('Bill').' '.$fac->ref;
$actiontypecode='AC_FAC';
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
@@ -1192,7 +1192,7 @@ if (($_POST['action'] == 'send' || $_POST['action'] == 'relance') && ! $_POST['a
}
if ($_POST['action'] == 'relance')
{
- if (strlen($_POST['subject'])) $subject = $_POST['subject'];
+ if (dol_strlen($_POST['subject'])) $subject = $_POST['subject'];
else $subject = $langs->transnoentities('Relance facture '.$fac->ref);
$actiontypecode='AC_FAC';
$actionmsg=$langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index ac6cc86f687..ae3287de0bf 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -434,7 +434,7 @@ class FactureRec extends Facture
// \TODO A virer
// Anciens indicateurs: $price, $remise (a ne plus utiliser)
- if (trim(strlen($remise_percent)) > 0)
+ if (trim(dol_strlen($remise_percent)) > 0)
{
$remise = round(($pu * $remise_percent / 100), 2);
$price = $pu - $remise;
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index 110c3f671e1..c045f362e70 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -211,7 +211,7 @@ if ($_REQUEST["search_montant_ttc"])
$sql .= " AND f.total_ttc = '".$_REQUEST["search_montant_ttc"]."'";
}
-if (strlen($_POST["sf_ref"]) > 0)
+if (dol_strlen($_POST["sf_ref"]) > 0)
{
$sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'";
}
diff --git a/htdocs/compta/param/comptes/liste.php b/htdocs/compta/param/comptes/liste.php
index 52b2364c833..87c5bea61b0 100644
--- a/htdocs/compta/param/comptes/liste.php
+++ b/htdocs/compta/param/comptes/liste.php
@@ -50,12 +50,12 @@ $sql = "SELECT cg.rowid, cg.numero, cg.intitule, cg.date_creation as dc";
$sql .= " FROM ".MAIN_DB_PREFIX."compta_compte_generaux as cg";
-if (strlen(trim($_GET["search_numero"])) )
+if (dol_strlen(trim($_GET["search_numero"])) )
{
$sql .= " WHERE cg.numero LIKE '%".$_GET["search_numero"]."%'";
- if ( strlen(trim($_GET["search_intitule"])))
+ if ( dol_strlen(trim($_GET["search_intitule"])))
{
$sql .= " AND cg.intitule LIKE '%".$_GET["search_intitule"]."%'";
}
@@ -63,7 +63,7 @@ if (strlen(trim($_GET["search_numero"])) )
}
else
{
- if ( strlen(trim($_GET["search_intitule"])))
+ if ( dol_strlen(trim($_GET["search_intitule"])))
{
$sql .= " WHERE cg.intitule LIKE '%".$_GET["search_intitule"]."%'";
}
diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php
index f3d419cad7d..570e0c9d3e8 100644
--- a/htdocs/compta/prelevement/demandes.php
+++ b/htdocs/compta/prelevement/demandes.php
@@ -79,7 +79,7 @@ if ($socid) $sql.= " AND f.fk_soc = ".$socid;
if (!$statut) $sql.= " AND pfd.traite = 0";
if ($statut) $sql.= " AND pfd.traite = ".$statut;
$sql.= " AND pfd.fk_facture = f.rowid";
-if (strlen(trim($_GET["search_societe"])))
+if (dol_strlen(trim($_GET["search_societe"])))
{
$sql.= " AND s.nom LIKE '%".$_GET["search_societe"]."%'";
}
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index 48293067b77..eeb4d7ac87c 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -556,9 +556,9 @@ class PaiementCharge extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET";
$sql.= " fk_charge=".(isset($this->fk_charge)?$this->fk_charge:"null").",";
- $sql.= " datec=".(strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
- $sql.= " tms=".(strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
- $sql.= " datep=".(strlen($this->datep)!=0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
+ $sql.= " datec=".(dol_strlen($this->datec)!=0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
+ $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
+ $sql.= " datep=".(dol_strlen($this->datep)!=0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
$sql.= " amount=".(isset($this->amount)?$this->amount:"null").",";
$sql.= " fk_typepaiement=".(isset($this->fk_typepaiement)?$this->fk_typepaiement:"null").",";
$sql.= " num_paiement=".(isset($this->num_paiement)?"'".addslashes($this->num_paiement)."'":"null").",";
diff --git a/htdocs/compta/ventilation/fournisseur/lignes.php b/htdocs/compta/ventilation/fournisseur/lignes.php
index 05d8db6ce5f..e0bb4a69db5 100644
--- a/htdocs/compta/ventilation/fournisseur/lignes.php
+++ b/htdocs/compta/ventilation/fournisseur/lignes.php
@@ -55,7 +55,7 @@ $sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c";
$sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 ";
$sql .= " AND c.rowid = l.fk_code_ventilation";
-if (strlen(trim($_GET["search_facture"])))
+if (dol_strlen(trim($_GET["search_facture"])))
{
$sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'";
}
diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php
index 6ef4fd246cd..ba8721582a0 100644
--- a/htdocs/compta/ventilation/lignes.php
+++ b/htdocs/compta/ventilation/lignes.php
@@ -59,7 +59,7 @@ $sql.= " , ".MAIN_DB_PREFIX."facturedet as l";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
$sql.= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 ";
$sql.= " AND c.rowid = l.fk_code_ventilation";
-if (strlen(trim($_GET["search_facture"])))
+if (dol_strlen(trim($_GET["search_facture"])))
{
$sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'";
}
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 89a855db67c..199b60d8ea0 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -306,7 +306,7 @@ class Contact extends CommonObject
$info["phpgwContactCatId"] = 0;
$info["phpgwContactAccess"] = "public";
- if (strlen($this->egroupware_id) == 0)
+ if (dol_strlen($this->egroupware_id) == 0)
{
$this->egroupware_id = 1;
}
diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php
index f8b1628b105..2ddc89814bd 100644
--- a/htdocs/contact/fiche.php
+++ b/htdocs/contact/fiche.php
@@ -334,17 +334,17 @@ if ($user->rights->societe->contact->creer)
print '
'.$langs->trans("PostOrFunction").'
poste).'">
';
// Address
- if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->address)) == 0) $contact->address = $objsoc->address; // Predefined with third party
+ if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($contact->address)) == 0) $contact->address = $objsoc->address; // Predefined with third party
print '
'.$langs->trans("Address").'
';
// Zip / Town
- if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->cp)) == 0) $contact->cp = $objsoc->cp; // Predefined with third party
- if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->ville)) == 0) $contact->ville = $objsoc->ville; // Predefined with third party
+ if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($contact->cp)) == 0) $contact->cp = $objsoc->cp; // Predefined with third party
+ if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($contact->ville)) == 0) $contact->ville = $objsoc->ville; // Predefined with third party
print '
';
// Country
- if (strlen(trim($contact->fk_pays)) == 0) $contact->fk_pays = $objsoc->pays_id; // Predefined with third party
+ if (dol_strlen(trim($contact->fk_pays)) == 0) $contact->fk_pays = $objsoc->pays_id; // Predefined with third party
print '
'.$langs->trans("Country").'
';
$form->select_pays((isset($_POST["pays_id"])?$_POST["pays_id"]:$contact->fk_pays),'pays_id',$conf->use_javascript_ajax?' onChange="company_save_refresh_create()"':'');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
@@ -363,16 +363,16 @@ if ($user->rights->societe->contact->creer)
print '
';
// Phone / Fax
- if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->phone_pro)) == 0) $contact->phone_pro = $objsoc->tel; // Predefined with third party
+ if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($contact->phone_pro)) == 0) $contact->phone_pro = $objsoc->tel; // Predefined with third party
print '
'.$langs->trans("PhonePro").'
phone_pro).'">
';
print '
'.$langs->trans("PhonePerso").'
phone_perso).'">
';
- if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->fax)) == 0) $contact->fax = $objsoc->fax; // Predefined with third party
+ if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($contact->fax)) == 0) $contact->fax = $objsoc->fax; // Predefined with third party
print '
'.$langs->trans("PhoneMobile").'
phone_mobile).'">
';
print '
'.$langs->trans("Fax").'
fax).'">
';
// EMail
- if (($objsoc->typent_code == 'TE_PRIVATE') && strlen(trim($contact->email)) == 0) $contact->email = $objsoc->email; // Predefined with third party
+ if (($objsoc->typent_code == 'TE_PRIVATE') && dol_strlen(trim($contact->email)) == 0) $contact->email = $objsoc->email; // Predefined with third party
print '
'.$langs->trans("Email").'
email).'">
';
// Jabberid
diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php
index 80abb4f9520..18fb9eed3de 100644
--- a/htdocs/contact/vcard.php
+++ b/htdocs/contact/vcard.php
@@ -90,7 +90,7 @@ $filenameurlencoded = dol_sanitizeFileName(urlencode($filename));
Header("Content-Disposition: attachment; filename=\"".$filename."\"");
-Header("Content-Length: ".strlen($output));
+Header("Content-Length: ".dol_strlen($output));
Header("Connection: close");
Header("Content-Type: text/x-vcard; name=\"".$filename."\"");
diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index 614a14a1300..2d58d6b65f6 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -104,8 +104,8 @@ class Contrat extends CommonObject
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."contratdet SET statut = 4,";
- $sql.= " date_ouverture = ".(strlen($date)!=0?"'".$this->db->idate($date)."'":"null").",";
- $sql.= " date_fin_validite = ".(strlen($date_end)!=0?"'".$this->db->idate($date_end)."'":"null").",";
+ $sql.= " date_ouverture = ".(dol_strlen($date)!=0?"'".$this->db->idate($date)."'":"null").",";
+ $sql.= " date_fin_validite = ".(dol_strlen($date_end)!=0?"'".$this->db->idate($date_end)."'":"null").",";
$sql.= " fk_user_ouverture = ".$user->id.",";
$sql.= " date_cloture = null,";
$sql.= " commentaire = '".addslashes($comment)."'";
@@ -562,7 +562,7 @@ class Contrat extends CommonObject
$sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL");
$sql.= ",".($this->commercial_suivi_id>0?$this->commercial_suivi_id:"NULL");
$sql.= ",".($this->fk_projet>0?$this->fk_projet:"NULL");
- $sql .= ", " . (strlen($this->ref)<=0 ? "null" : "'".$this->ref."'");
+ $sql .= ", " . (dol_strlen($this->ref)<=0 ? "null" : "'".$this->ref."'");
$sql.= ")";
$resql=$this->db->query($sql);
if ($resql)
@@ -805,7 +805,7 @@ class Contrat extends CommonObject
// Anciens indicateurs: $price, $remise (a ne plus utiliser)
$remise = 0;
$price = price2num(round($pu_ht, 2));
- if (strlen($remise_percent) > 0)
+ if (dol_strlen($remise_percent) > 0)
{
$remise = round(($pu_ht * $remise_percent / 100), 2);
$price = $pu_ht - $remise;
@@ -899,7 +899,7 @@ class Contrat extends CommonObject
$localtax2tx = price2num($localtax2tx);
$subprice = $price;
$remise = 0;
- if (strlen($remise_percent) > 0)
+ if (dol_strlen($remise_percent) > 0)
{
$remise = round(($pu * $remise_percent / 100), 2);
$price = $pu - $remise;
diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php
index d76a17161a1..16191188195 100644
--- a/htdocs/core/class/cookie.class.php
+++ b/htdocs/core/class/cookie.class.php
@@ -62,7 +62,7 @@ class DolCookie
if (!empty($this->myKey))
{
$valuecrypt = base64_encode($this->myValue);
- for ($f=0 ; $f<=strlen($valuecrypt)-1; $f++)
+ for ($f=0 ; $f<=dol_strlen($valuecrypt)-1; $f++)
{
$this->cookie .= intval(ord($valuecrypt[$f]))*$this->myKey."|";
}
@@ -191,7 +191,7 @@ class DolCookie
$file=DOL_DOCUMENT_ROOT.'/conf/conf.php';
if ($fp = @fopen($file,'w'))
{
- fputs($fp, $config, strlen($config));
+ fputs($fp, $config, dol_strlen($config));
fclose($fp);
// It's config file, so we set permission for creator only
// @chmod($file, octdec('0600'));
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 2ff4bc232ec..d36733ca4ec 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -355,7 +355,7 @@ class DolGraph
{
$max = $this->GetMaxValueInData();
if ($max != 0) $max++;
- $size=strlen(abs(ceil($max)));
+ $size=dol_strlen(abs(ceil($max)));
$factor=1;
for ($i=0; $i < ($size-1); $i++)
{
@@ -378,7 +378,7 @@ class DolGraph
{
$min = $this->GetMinValueInData();
if ($min != 0) $min--;
- $size=strlen(abs(floor($min)));
+ $size=dol_strlen(abs(floor($min)));
$factor=1;
for ($i=0; $i < ($size-1); $i++)
{
@@ -452,7 +452,7 @@ class DolGraph
$paddleft=50;
$paddright=10;
- $strl=strlen(max(abs($this->MaxValue),abs($this->MinValue)));
+ $strl=dol_strlen(max(abs($this->MaxValue),abs($this->MinValue)));
if ($strl > 6) $paddleft += ($strln * 4);
$group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values
$group->legend->setSpace(0);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 45c2f47fffc..08837f60a9e 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1007,8 +1007,8 @@ class Form
$found=0;
$currencytext=$langs->trans("Currency".$conf->monnaie);
$currencytextnoent=$langs->transnoentities("Currency".$conf->monnaie);
- if (strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code
- if (strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code
+ if (dol_strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code
+ if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code
// Multiprice
if ($price_level >= 1) // If we need a particular price level (from 1 to 6)
@@ -1069,7 +1069,7 @@ class Form
if ($objp->duration)
{
- $duration_value = substr($objp->duration,0,strlen($objp->duration)-1);
+ $duration_value = substr($objp->duration,0,dol_strlen($objp->duration)-1);
$duration_unit = substr($objp->duration,-1);
if ($duration_value > 1)
{
@@ -1242,8 +1242,8 @@ class Form
{
$currencytext=$langs->trans("Currency".$conf->monnaie);
$currencytextnoent=$langs->transnoentities("Currency".$conf->monnaie);
- if (strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code
- if (strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code
+ if (dol_strlen($currencytext) > 10) $currencytext=$conf->monnaie; // If text is too long, we use the short code
+ if (dol_strlen($currencytextnoent) > 10) $currencytextnoent=$conf->monnaie; // If text is too long, we use the short code
$opt.= price($objp->fprice).' '.$currencytext."/".$objp->quantity;
$outval.= price($objp->fprice).' '.$currencytextnoent."/".$objp->quantity;
@@ -2427,14 +2427,14 @@ class Form
}
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')
- if ($defaulttx < 0 || strlen($defaulttx) == 0)
+ if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
{
$defaulttx=get_default_tva($societe_vendeuse,$societe_acheteuse,$idprod);
$defaultnpr=get_default_npr($societe_vendeuse,$societe_acheteuse,$idprod);
}
// Si taux par defaut n'a pu etre determine, on prend dernier de la liste.
// Comme ils sont tries par ordre croissant, dernier = plus eleve = taux courant
- if ($defaulttx < 0 || strlen($defaulttx) == 0)
+ if ($defaulttx < 0 || dol_strlen($defaulttx) == 0)
{
$defaulttx = $txtva[sizeof($txtva)-1];
}
@@ -2676,7 +2676,7 @@ class Form
if ($empty) $retstring.='';
for ($hour = 0; $hour < 24; $hour++)
{
- if (strlen($hour) < 2)
+ if (dol_strlen($hour) < 2)
{
$hour = "0" . $hour;
}
@@ -2702,7 +2702,7 @@ class Form
if ($empty) $retstring.='';
for ($min = 0; $min < 60 ; $min++)
{
- if (strlen($min) < 2)
+ if (dol_strlen($min) < 2)
{
$min = "0" . $min;
}
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 41d497260db..83e1375bf44 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -152,7 +152,7 @@ class Notify
$sendto = $obj->firstname . " " . $obj->name . " <".$obj->email.">";
$actiondefid = $obj->adid;
- if (strlen($sendto))
+ if (dol_strlen($sendto))
{
include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
$application=($conf->global->MAIN_APPLICATION_TITLE?$conf->global->MAIN_APPLICATION_TITLE:'Dolibarr ERP/CRM');
diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php
index acf84cf22f6..7f235472ea9 100644
--- a/htdocs/ecm/class/ecmdirectory.class.php
+++ b/htdocs/ecm/class/ecmdirectory.class.php
@@ -611,7 +611,7 @@ class EcmDirectory // extends CommonObject
$this->cats[$id_categ]['fulllabel']=$this->cats[$id_categ]['label'];
}
// We count number of _ to have level
- $this->cats[$id_categ]['level']=strlen(preg_replace('/([^_])/i','',$this->cats[$id_categ]['fullpath']));
+ $this->cats[$id_categ]['level']=dol_strlen(preg_replace('/([^_])/i','',$this->cats[$id_categ]['fullpath']));
// Traite ces enfants
$protection++;
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index bc62ac16599..a73baa571ed 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -604,16 +604,16 @@ class Expedition extends CommonObject
// Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition SET";
- $sql.= " tms=".(strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
+ $sql.= " tms=".(dol_strlen($this->tms)!=0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
$sql.= " ref=".(isset($this->ref)?"'".addslashes($this->ref)."'":"null").",";
$sql.= " ref_customer=".(isset($this->ref_customer)?"'".addslashes($this->ref_customer)."'":"null").",";
$sql.= " fk_soc=".(isset($this->socid)?$this->socid:"null").",";
- $sql.= " date_creation=".(strlen($this->date_creation)!=0 ? "'".$this->db->idate($this->date_creation)."'" : 'null').",";
+ $sql.= " date_creation=".(dol_strlen($this->date_creation)!=0 ? "'".$this->db->idate($this->date_creation)."'" : 'null').",";
$sql.= " fk_user_author=".(isset($this->fk_user_author)?$this->fk_user_author:"null").",";
- $sql.= " date_valid=".(strlen($this->date_valid)!=0 ? "'".$this->db->idate($this->date_valid)."'" : 'null').",";
+ $sql.= " date_valid=".(dol_strlen($this->date_valid)!=0 ? "'".$this->db->idate($this->date_valid)."'" : 'null').",";
$sql.= " fk_user_valid=".(isset($this->fk_user_valid)?$this->fk_user_valid:"null").",";
- $sql.= " date_expedition=".(strlen($this->date_expedition)!=0 ? "'".$this->db->idate($this->date_expedition)."'" : 'null').",";
- $sql.= " date_delivery=".(strlen($this->date_delivery)!=0 ? "'".$this->db->idate($this->date_delivery)."'" : 'null').",";
+ $sql.= " date_expedition=".(dol_strlen($this->date_expedition)!=0 ? "'".$this->db->idate($this->date_expedition)."'" : 'null').",";
+ $sql.= " date_delivery=".(dol_strlen($this->date_delivery)!=0 ? "'".$this->db->idate($this->date_delivery)."'" : 'null').",";
$sql.= " fk_address=".(isset($this->fk_adresse_livraison)?$this->fk_adresse_livraison:"null").",";
$sql.= " fk_expedition_methode=".(isset($this->expedition_method_id)?$this->expedition_method_id:"null").",";
$sql.= " tracking_number=".(isset($this->tracking_number)?"'".addslashes($this->tracking_number)."'":"null").",";
diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php
index 0a46f9c6664..074809155cd 100644
--- a/htdocs/expedition/fiche.php
+++ b/htdocs/expedition/fiche.php
@@ -667,7 +667,7 @@ else
$expedition->fetch_object();
}
- if (strlen($expedition->tracking_number))
+ if (dol_strlen($expedition->tracking_number))
{
$expedition->GetUrlTrackingStatus();
}
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index 8de12d235b4..7b4080f5d29 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -174,7 +174,7 @@ class Fichinter extends CommonObject
global $conf;
if (! is_numeric($this->duree)) { $this->duree = 0; }
- if (! strlen($this->fk_project)) { $this->fk_project = 0; }
+ if (! dol_strlen($this->fk_project)) { $this->fk_project = 0; }
/*
* Insertion dans la base
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 8b697baa38c..53dff0b4938 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -614,7 +614,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
}
}
- if (strlen($sendto))
+ if (dol_strlen($sendto))
{
$langs->load("commercial");
@@ -626,7 +626,7 @@ if ($_POST['action'] == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile']
if ($_POST['action'] == 'send')
{
- if (strlen($_POST['subject'])) $subject=$_POST['subject'];
+ if (dol_strlen($_POST['subject'])) $subject=$_POST['subject'];
else $subject = $langs->transnoentities('CustomerOrder').' '.$commande->ref;
$actiontypecode='AC_SUP_ORD';
$actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n";
diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php
index a4240548c55..9bae9fbb24e 100644
--- a/htdocs/fourn/commande/liste.php
+++ b/htdocs/fourn/commande/liste.php
@@ -106,7 +106,7 @@ if ($sall)
}
if ($socid) $sql.= " AND s.rowid = ".$socid;
-if (strlen($_GET["statut"]))
+if (dol_strlen($_GET["statut"]))
{
$sql .= " AND fk_statut =".$_GET["statut"];
}
diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php
index 6c3aa016563..9cef3874718 100644
--- a/htdocs/fourn/contact.php
+++ b/htdocs/fourn/contact.php
@@ -68,11 +68,11 @@ if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFI
$sql .= " WHERE s.fk_stcomm = st.id AND s.fournisseur = 1 AND s.rowid = p.fk_soc";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
-if (strlen($stcomm)) {
+if (dol_strlen($stcomm)) {
$sql .= " AND s.fk_stcomm=$stcomm";
}
-if (strlen($begin)) {
+if (dol_strlen($begin)) {
$sql .= " AND p.name like '$begin%'";
}
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index f99834bac8c..64dbff428e7 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -125,7 +125,7 @@ if ($user->rights->fournisseur->facture->lire)
$sql .= " AND f.total_ttc = '".$_GET["search_montant_ttc"]."'";
}
- if (strlen($_POST["sf_ref"]) > 0)
+ if (dol_strlen($_POST["sf_ref"]) > 0)
{
$sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'";
}
diff --git a/htdocs/includes/boxes/box_factures.php b/htdocs/includes/boxes/box_factures.php
index 9228fc2ddca..3644c72b7ae 100644
--- a/htdocs/includes/boxes/box_factures.php
+++ b/htdocs/includes/boxes/box_factures.php
@@ -67,7 +67,7 @@ class box_factures extends ModeleBoxes {
$text = $langs->trans("BoxTitleLastCustomerBills",$max);
$this->info_box_head = array(
'text' => $text,
- 'limit'=> strlen($text)
+ 'limit'=> dol_strlen($text)
);
if ($user->rights->facture->lire)
diff --git a/htdocs/includes/modules/DolibarrModules.class.php b/htdocs/includes/modules/DolibarrModules.class.php
index af46f94579a..2261541bd42 100644
--- a/htdocs/includes/modules/DolibarrModules.class.php
+++ b/htdocs/includes/modules/DolibarrModules.class.php
@@ -885,9 +885,9 @@ class DolibarrModules
if (empty($r_type)) $r_type='w';
- if (strlen($r_perms) )
+ if (dol_strlen($r_perms) )
{
- if (strlen($r_subperms) )
+ if (dol_strlen($r_subperms) )
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."rights_def";
$sql.= " (id, entity, libelle, module, type, bydefault, perms, subperms)";
diff --git a/htdocs/includes/modules/cheque/pdf/modules_chequereceipts.php b/htdocs/includes/modules/cheque/pdf/modules_chequereceipts.php
index 72e5c850d7e..1d6eab22970 100644
--- a/htdocs/includes/modules/cheque/pdf/modules_chequereceipts.php
+++ b/htdocs/includes/modules/cheque/pdf/modules_chequereceipts.php
@@ -80,7 +80,7 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs)
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/cheque/pdf/";
// Positionne modele sur le nom du modele a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if ($conf->global->FACTURE_ADDON_PDF)
{
diff --git a/htdocs/includes/modules/dons/modules_don.php b/htdocs/includes/modules/dons/modules_don.php
index 99a71af6c8b..6ef01d0731f 100644
--- a/htdocs/includes/modules/dons/modules_don.php
+++ b/htdocs/includes/modules/dons/modules_don.php
@@ -147,7 +147,7 @@ function don_create($db, $id, $message, $modele, $outputlangs)
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/dons/";
// Positionne modele sur le nom du modele � utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if ($conf->global->DON_ADDON_MODEL)
{
diff --git a/htdocs/includes/modules/facture/modules_facture.php b/htdocs/includes/modules/facture/modules_facture.php
index b32548282f4..27b15b2cd4f 100644
--- a/htdocs/includes/modules/facture/modules_facture.php
+++ b/htdocs/includes/modules/facture/modules_facture.php
@@ -149,7 +149,7 @@ function facture_pdf_create($db, $id, $message, $modele, $outputlangs)
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/facture/";
// Positionne modele sur le nom du modele a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if ($conf->global->FACTURE_ADDON_PDF)
{
diff --git a/htdocs/includes/modules/fichinter/modules_fichinter.php b/htdocs/includes/modules/fichinter/modules_fichinter.php
index fee94cba136..bf4b2c638cd 100644
--- a/htdocs/includes/modules/fichinter/modules_fichinter.php
+++ b/htdocs/includes/modules/fichinter/modules_fichinter.php
@@ -153,7 +153,7 @@ function fichinter_create($db, $object, $modele='', $outputlangs='')
$dir = DOL_DOCUMENT_ROOT."/includes/modules/fichinter/";
// Positionne modele sur le nom du modele de facture a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if ($conf->global->FICHEINTER_ADDON_PDF)
{
diff --git a/htdocs/includes/modules/import/import_csv.modules.php b/htdocs/includes/modules/import/import_csv.modules.php
index 1f14cc282af..077ca9e21b8 100644
--- a/htdocs/includes/modules/import/import_csv.modules.php
+++ b/htdocs/includes/modules/import/import_csv.modules.php
@@ -226,12 +226,12 @@ class ImportCsv extends ModeleImports
if (strtolower($conf->global->IMPORT_CSV_FORCE_CHARSET) == 'utf8')
{
$newarrayres[$key]['val']=$val;
- $newarrayres[$key]['type']=(strlen($val)?1:-1); // If empty we considere it's null
+ $newarrayres[$key]['type']=(dol_strlen($val)?1:-1); // If empty we considere it's null
}
else
{
$newarrayres[$key]['val']=utf8_encode($val);
- $newarrayres[$key]['type']=(strlen($val)?1:-1); // If empty we considere it's null
+ $newarrayres[$key]['type']=(dol_strlen($val)?1:-1); // If empty we considere it's null
}
}
else // Autodetect format (UTF8 or ISO)
@@ -239,12 +239,12 @@ class ImportCsv extends ModeleImports
if (utf8_check($val))
{
$newarrayres[$key]['val']=$val;
- $newarrayres[$key]['type']=(strlen($val)?1:-1); // If empty we considere it's null
+ $newarrayres[$key]['type']=(dol_strlen($val)?1:-1); // If empty we considere it's null
}
else
{
$newarrayres[$key]['val']=utf8_encode($val);
- $newarrayres[$key]['type']=(strlen($val)?1:-1); // If empty we considere it's null
+ $newarrayres[$key]['type']=(dol_strlen($val)?1:-1); // If empty we considere it's null
}
}
}
diff --git a/htdocs/includes/modules/livraison/modules_livraison.php b/htdocs/includes/modules/livraison/modules_livraison.php
index 286e1df754e..b00a0f9034a 100644
--- a/htdocs/includes/modules/livraison/modules_livraison.php
+++ b/htdocs/includes/modules/livraison/modules_livraison.php
@@ -147,7 +147,7 @@ function delivery_order_pdf_create($db, $deliveryid, $modele='', $outputlangs=''
$dir = DOL_DOCUMENT_ROOT."/includes/modules/livraison/pdf/";
// Positionne modele sur le nom du modele de bon de livraison a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if ($conf->global->LIVRAISON_ADDON_PDF)
{
diff --git a/htdocs/includes/modules/mailings/peche.modules.php b/htdocs/includes/modules/mailings/peche.modules.php
index ad1d46e451a..2989ed2df23 100644
--- a/htdocs/includes/modules/mailings/peche.modules.php
+++ b/htdocs/includes/modules/mailings/peche.modules.php
@@ -143,7 +143,7 @@ class mailing_peche extends MailingTargets
$other=$tab[3];
if (! empty($buffer))
{
- //print 'xx'.strlen($buffer).empty($buffer)." \n";
+ //print 'xx'.dol_strlen($buffer).empty($buffer)." \n";
$id=$cpt;
if (isValidEMail($email))
{
diff --git a/htdocs/includes/modules/member/cards/modules_cards.php b/htdocs/includes/modules/member/cards/modules_cards.php
index 761920db8b2..29a04a084c1 100644
--- a/htdocs/includes/modules/member/cards/modules_cards.php
+++ b/htdocs/includes/modules/member/cards/modules_cards.php
@@ -77,7 +77,7 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs)
$dir = DOL_DOCUMENT_ROOT . "/includes/modules/member/cards/";
// Positionne modele sur le nom du modele a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if ($conf->global->ADHERENT_CARDS_ADDON_PDF)
{
diff --git a/htdocs/includes/modules/project/modules_project.php b/htdocs/includes/modules/project/modules_project.php
index 0ee01ca09de..96c81aa4b61 100644
--- a/htdocs/includes/modules/project/modules_project.php
+++ b/htdocs/includes/modules/project/modules_project.php
@@ -149,7 +149,7 @@ function project_pdf_create($db, $comid, $modele,$outputlangs)
$dir = DOL_DOCUMENT_ROOT."/includes/modules/project/pdf/";
// Positionne modele sur le nom du modele de projet a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if (! empty($conf->global->PROJECT_ADDON_PDF))
{
diff --git a/htdocs/includes/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/includes/modules/security/generate/modGeneratePassStandard.class.php
index 832cff235a0..73e245e7556 100644
--- a/htdocs/includes/modules/security/generate/modGeneratePassStandard.class.php
+++ b/htdocs/includes/modules/security/generate/modGeneratePassStandard.class.php
@@ -99,7 +99,7 @@ class modGeneratePassStandard extends ModeleGenPassword
{
// pick a random character from the possible ones
- $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
+ $char = substr($possible, mt_rand(0, dol_strlen($possible)-1), 1);
// we don't want this character if it's already in the password
if (!strstr($password, $char))
@@ -120,7 +120,7 @@ class modGeneratePassStandard extends ModeleGenPassword
*/
function validatePassword($password)
{
- if (strlen($password) < $this->length) return 0;
+ if (dol_strlen($password) < $this->length) return 0;
return 1;
}
}
diff --git a/htdocs/includes/modules/societe/mod_codeclient_monkey.php b/htdocs/includes/modules/societe/mod_codeclient_monkey.php
index c0f28f12c7c..5c2249bcf2b 100644
--- a/htdocs/includes/modules/societe/mod_codeclient_monkey.php
+++ b/htdocs/includes/modules/societe/mod_codeclient_monkey.php
@@ -177,7 +177,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
}
else
{
- if (strlen($code) == 0)
+ if (dol_strlen($code) == 0)
{
$result=-2;
}
@@ -235,7 +235,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
{
$res = 0;
- if (strlen($code) < 11)
+ if (dol_strlen($code) < 11)
{
$res = -1;
}
diff --git a/htdocs/includes/modules/societe/modules_societe.class.php b/htdocs/includes/modules/societe/modules_societe.class.php
index 736f08cbe56..8147c97596e 100644
--- a/htdocs/includes/modules/societe/modules_societe.class.php
+++ b/htdocs/includes/modules/societe/modules_societe.class.php
@@ -290,7 +290,7 @@ function thirdparty_doc_create($db, $id, $message, $modele, $outputlangs)
$srctemplatepath='';
// Positionne modele sur le nom du modele a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if ($conf->global->COMPANY_ADDON_PDF)
{
diff --git a/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php b/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
index 2a05867993c..854b0a2f0ea 100644
--- a/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
+++ b/htdocs/includes/modules/supplier_order/modules_commandefournisseur.php
@@ -148,7 +148,7 @@ function supplier_order_pdf_create($db, $comid, $modele,$outputlangs)
$dir = DOL_DOCUMENT_ROOT."/includes/modules/supplier_order/pdf/";
// Positionne modele sur le nom du modele de commande fournisseur a utiliser
- if (! strlen($modele))
+ if (! dol_strlen($modele))
{
if (! empty($conf->global->COMMANDE_SUPPLIER_ADDON_PDF))
{
diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php
index 15b0dae5b9c..c848622dc68 100644
--- a/htdocs/install/etape1.php
+++ b/htdocs/install/etape1.php
@@ -54,15 +54,15 @@ $error = 0;
$main_dir=isset($_POST["main_dir"])?trim($_POST["main_dir"]):'';
// On supprime / de fin dans main_dir
-if (substr($main_dir, strlen($main_dir) -1) == "/")
+if (substr($main_dir, dol_strlen($main_dir) -1) == "/")
{
- $main_dir = substr($main_dir, 0, strlen($main_dir)-1);
+ $main_dir = substr($main_dir, 0, dol_strlen($main_dir)-1);
}
// On supprime / de fin dans main_url
-if (substr($_POST["main_url"], strlen($_POST["main_url"]) -1) == "/")
+if (substr($_POST["main_url"], dol_strlen($_POST["main_url"]) -1) == "/")
{
- $_POST["main_url"] = substr($_POST["main_url"], 0, strlen($_POST["main_url"])-1);
+ $_POST["main_url"] = substr($_POST["main_url"], 0, dol_strlen($_POST["main_url"])-1);
}
// Directory for generated documents (invoices, orders, ecm, etc...)
diff --git a/htdocs/install/etape2.php b/htdocs/install/etape2.php
index c0caa20c7a7..9d8ee7f9912 100644
--- a/htdocs/install/etape2.php
+++ b/htdocs/install/etape2.php
@@ -151,7 +151,7 @@ if ($_POST["action"] == "set")
sort($tabledata);
foreach($tabledata as $file)
{
- $name = substr($file, 0, strlen($file) - 4);
+ $name = substr($file, 0, dol_strlen($file) - 4);
$buffer = '';
$fp = fopen($dir.$file,"r");
if ($fp)
@@ -261,7 +261,7 @@ if ($_POST["action"] == "set")
sort($tabledata);
foreach($tabledata as $file)
{
- $name = substr($file, 0, strlen($file) - 4);
+ $name = substr($file, 0, dol_strlen($file) - 4);
//print "