diff --git a/.travis.yml b/.travis.yml index 6ed538bdb8b..3408644a353 100644 --- a/.travis.yml +++ b/.travis.yml @@ -467,8 +467,8 @@ script: - | echo "Unit testing" - # Ensure we catch errors. Set this to +e instead of -e if you want to go to the end to see dolibarr.log file. - set +e + # Ensure we catch errors with -e. Set this to +e instead of -e if you want to go to the end to see dolibarr.log file. + set -e phpunit -d memory_limit=-1 -c test/phpunit/phpunittest.xml test/phpunit/AllTests.php phpunitresult=$? echo "Phpunit return code = $phpunitresult" diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index b7fa041bed2..12894843593 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -48,6 +48,8 @@ $execmethod = getDolGlobalInt('MAIN_EXEC_USE_POPEN', 1); * View */ +$form = new Form($db); + llxHeader(); print load_fiche_titre($langs->trans("Security"), '', 'title_setup'); @@ -169,6 +171,12 @@ if (in_array($functiontokeep, $arrayoffunctionsdisabled)) { print ''.$functiontokeep.''; print '
'; +$arrayofstreams = stream_get_wrappers(); +if (!empty($arrayofstreams)) { + sort($arrayofstreams); + print "PHP streams = ".(join(',', $arrayofstreams)).'   ('.$langs->trans("RecommendedValueIs", 'file,http,https,php').')'."
\n"; +} + print '
'; // XDebug @@ -669,7 +677,7 @@ print '
'; print 'WEBSITE_MAIN_SECURITY_FORCESTS = '.getDolGlobalString('>WEBSITE_MAIN_SECURITY_FORCESTS', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"max-age=31536000; includeSubDomains\")
"; print '
'; -print 'WEBSITE_MAIN_SECURITY_FORCEPP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"camera: 'none'; microphone: 'none';\")
"; +print 'WEBSITE_MAIN_SECURITY_FORCEPP = '.getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP', ''.$langs->trans("Undefined").'').'   ('.$langs->trans("Example").": \"camera: (); microphone: ();\")
"; print '
'; print '
'; @@ -678,7 +686,7 @@ print '
'; print load_fiche_titre($langs->trans("LimitsAndMitigation"), '', 'folder'); print ''; -print 'For a higher security, we also recommend to implement limits and mitigation on number of endpoints per minutes for the following URL'."
"; +print $langs->trans("RecommendMitigationOnURL").'
'; print '
'; print '
'; diff --git a/htdocs/asset/class/assetaccountancycodes.class.php b/htdocs/asset/class/assetaccountancycodes.class.php index 6c33e3af901..f52dc20a5f5 100644 --- a/htdocs/asset/class/assetaccountancycodes.class.php +++ b/htdocs/asset/class/assetaccountancycodes.class.php @@ -94,6 +94,7 @@ class AssetAccountancyCodes extends CommonObject $this->accountancy_codes[$mode_key][$field_key] = $accountancy_code; } } + return $this->accountancy_codes; } /** diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 09b2c1e6185..dc2181e8e46 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1214,6 +1214,7 @@ class FactureRec extends CommonInvoice return -1; } } + return -1; } diff --git a/htdocs/compta/prelevement/class/ligneprelevement.class.php b/htdocs/compta/prelevement/class/ligneprelevement.class.php index 6ed518f7f2f..9faafb99d84 100644 --- a/htdocs/compta/prelevement/class/ligneprelevement.class.php +++ b/htdocs/compta/prelevement/class/ligneprelevement.class.php @@ -126,7 +126,7 @@ class LignePrelevement * * @param int $status Id status * @param int $mode 0=Label, 1=Picto + label, 2=Picto, 3=Label + Picto - * @return string Label + * @return null|string Label */ public function LibStatut($status, $mode = 0) { @@ -160,7 +160,6 @@ class LignePrelevement return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut8', 'class="valignmiddle"'); } } - //return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode); } diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index 741179d067e..b9b28f823b6 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -501,6 +501,7 @@ class Cchargesociales return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'), 'statut5'); } } + return ""; } diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 66bd680739d..7a65b75cf58 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -730,8 +730,10 @@ class ChargeSociales extends CommonObject } $this->db->free($result); + return 1; } else { dol_print_error($this->db); + return -1; } } diff --git a/htdocs/core/lib/functionsnumtoword.lib.php b/htdocs/core/lib/functionsnumtoword.lib.php index f14295ab068..cdc288abd17 100644 --- a/htdocs/core/lib/functionsnumtoword.lib.php +++ b/htdocs/core/lib/functionsnumtoword.lib.php @@ -163,7 +163,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false) * @param float $numero Number to convert * @param Translate $langs Language * @param string $numorcurrency 'number' or 'amount' - * @return string Text of the number or -1 in case TOO LONG (more than 1000000000000.99) + * @return string|int Text of the number or -1 in case TOO LONG (more than 1000000000000.99) */ function dolNumberToWord($numero, $langs, $numorcurrency = 'number') { diff --git a/htdocs/core/modules/action/rapport.class.php b/htdocs/core/modules/action/rapport.class.php index a880b894b73..d43ebc17d01 100644 --- a/htdocs/core/modules/action/rapport.class.php +++ b/htdocs/core/modules/action/rapport.class.php @@ -215,6 +215,7 @@ class CommActionRapport return 1; } + return 0; } /** diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 913c9a879ba..37d9913a953 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -388,6 +388,6 @@ class pdf_ban extends ModeleBankAccountDoc global $conf; $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS; - //return pdf_pagefoot($pdf,$outputlangs,'BANK_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext); + return 1; } } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index b8a58d3b517..ec409109d2d 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1109,6 +1109,7 @@ class pdf_standard extends ModeleExpenseReport $this->error = $this->db->lasterror(); return -1; } + return -1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php index fb4ba06b9ce..91f60af5ad0 100644 --- a/htdocs/core/modules/facture/mod_facture_mars.php +++ b/htdocs/core/modules/facture/mod_facture_mars.php @@ -158,7 +158,7 @@ class mod_facture_mars extends ModeleNumRefFactures * @param Societe $objsoc Object third party * @param Facture $invoice Object invoice * @param string $mode 'next' for next value or 'last' for last value - * @return string Value if OK, 0 if KO + * @return string|int Value if OK, 0 if KO */ public function getNextValue($objsoc, $invoice, $mode = 'next') { @@ -233,6 +233,7 @@ class mod_facture_mars extends ModeleNumRefFactures return $prefix.$yymm."-".$num; } else { dol_print_error('', 'Bad parameter for getNextValue'); + return -1; } } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index ced14b802a0..111943e99e0 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -308,5 +308,6 @@ class mailing_advthirdparties extends MailingTargets $contactstatic->fetch($id); return $contactstatic->getNomUrl(0, '', 0, '', -1, 1); } + return ""; } } diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 982d7a4ba85..3dfb6bfd4d2 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -1057,6 +1057,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->error = $this->db->lasterror(); return -1; } + return -1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index d3b9681a63f..8646ecac0c9 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -546,6 +546,7 @@ class pdf_standard extends ModelePDFSuppliersPayments // Date $pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy); $pdf->MultiCell(150, 4, date("d").' '.$outputlangs->transnoentitiesnoconv(date("F")).' '.date("Y"), 0, 'L', 1); + return $posy; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php index 31eb9345110..2295209bb82 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php @@ -130,7 +130,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos * @param Societe $objsoc Object third party * @param Facture $invoice Object invoice * @param string $mode 'next' for next value or 'last' for last value - * @return string Next ref value or last ref if $mode is 'last' + * @return string|int Next ref value or last ref if $mode is 'last' */ public function getNextValue($objsoc = null, $invoice = null, $mode = 'next') { @@ -198,6 +198,7 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos return $this->prefix.$pos_source.'-'.$yymm.'-'.$num; } else { dol_print_error('', 'Bad parameter for getNextValue'); + return -1; } } diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 5dc92c9d057..ff1964fbe9f 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2100,6 +2100,7 @@ class CommandeFournisseur extends CommonOrder return -1; } } + return -1; } diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index e4bccaa0980..0b8e70ee6c3 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -609,6 +609,7 @@ class CommandeFournisseurDispatch extends CommonObjectLine return ''.$langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut8'); } } + return ""; } diff --git a/htdocs/langs/es_CU/main.lang b/htdocs/langs/es_CU/main.lang index 7c4f5a84497..b52bef7a2ec 100644 --- a/htdocs/langs/es_CU/main.lang +++ b/htdocs/langs/es_CU/main.lang @@ -1,6 +1,6 @@ # Dolibarr language file - Source file is en_US - main DIRECTION=litros -FONTFORPDF=helvética +FONTFORPDF=helvetica FONTSIZEFORPDF=10 SeparatorDecimal=. SeparatorThousand=, diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 98bb6acdd2a..e207fdfd8a6 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -2397,3 +2397,4 @@ DefaultForTypeDesc=Modèle utilisé par défaut lors de la création d'un nouvel OptionXShouldBeEnabledInModuleY=L'option "%s" doit être activée dans le module %s OptionXIsCorrectlyEnabledInModuleY=L'option "%s" doit être activée dans le module %s AtBottomOfPage=En bas de page +RecommendMitigationOnURL=For a higher security, we also recommend to implement limits and mitigation on number of endpoints per minutes for the following URL \ No newline at end of file diff --git a/htdocs/langs/zh_HK/main.lang b/htdocs/langs/zh_HK/main.lang index bbb4ed227c4..b72b47c566c 100644 --- a/htdocs/langs/zh_HK/main.lang +++ b/htdocs/langs/zh_HK/main.lang @@ -10,7 +10,7 @@ DIRECTION=ltr # DejaVuSans is for some Eastern languages, some Asian languages and some Arabic languages # freemono is for ru_RU or uk_UA, uz_UZ # freeserif is for Tamil -FONTFORPDF=helvetica +FONTFORPDF=msungstdlight FONTSIZEFORPDF=10 SeparatorDecimal=. SeparatorThousand=,