diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 747929498e9..d68f4e79f5e 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -446,7 +446,7 @@ class AccountancyCategory // extends CommonObject } else { $this->error = "Error ".$this->db->lasterror(); $this->errors[] = $this->error; - dol_syslog(__METHOD__." ".implode(','.$this->errors), LOG_ERR); + dol_syslog(__METHOD__." ".implode(',', $this->errors), LOG_ERR); return -1; } @@ -488,7 +488,7 @@ class AccountancyCategory // extends CommonObject } else { $this->error = "Error ".$this->db->lasterror(); $this->errors[] = $this->error; - dol_syslog(__METHOD__." ".implode(','.$this->errors), LOG_ERR); + dol_syslog(__METHOD__." ".implode(',', $this->errors), LOG_ERR); return -1; } diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 273f79b8ac8..d0a3c6ba271 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -565,7 +565,7 @@ if (empty($reshook)) { } if (!empty($object->url) && !isValidUrl($object->url)) { $langs->load("errors"); - setEventMessages('', $langs->trans("ErrorBadUrl", $object->url), 'errors'); + setEventMessages($langs->trans("ErrorBadUrl", $object->url), null, 'errors'); } $public = 0; if (isset($public)) { diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 085dd338e69..ba195b82c08 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -413,9 +413,9 @@ $result = $api->r->handle(); if (Luracast\Restler\Defaults::$returnResponse) { // We try to compress the data received data - if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'br') !== false && is_callable('brotli_compress')) { + if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'br') !== false && is_callable('brotli_compress') && defined('BROTLI_TEXT')) { header('Content-Encoding: br'); - $result = brotli_compress($result, 11, BROTLI_TEXT); + $result = brotli_compress($result, 11, constant('BROTLI_TEXT')); } elseif (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'bz') !== false && is_callable('bzcompress')) { header('Content-Encoding: bz'); $result = bzcompress($result, 9); diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index 7240aaf0151..0b665fedc3e 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/htdocs/blockedlog/class/authority.class.php @@ -304,7 +304,7 @@ class BlockedLogAuthority $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s='.$signature.'&b='.$block->signature; $res = getURLContent($url); - echo $block->signature.' '.$url.' '.$res.'
'; + echo $block->signature.' '.$url.' '.$res['content'].'
'; if ($res === 'blockalreadyadded' || $res === 'blockadded') { $block->setCertified(); } else { diff --git a/htdocs/core/class/dolgeoip.class.php b/htdocs/core/class/dolgeoip.class.php index b4218bbfd40..24726fec7c3 100644 --- a/htdocs/core/class/dolgeoip.class.php +++ b/htdocs/core/class/dolgeoip.class.php @@ -86,8 +86,8 @@ class DolGeoIP dol_syslog('DolGeoIP '.$this->errorlabel, LOG_ERR); return 0; } - } elseif (function_exists('geoip_open')) { - $this->gi = geoip_open($datfile, GEOIP_STANDARD); + } elseif (function_exists('geoip_open') && defined('GEOIP_STANDARD')) { + $this->gi = geoip_open($datfile, constant('GEOIP_STANDARD')); } elseif (function_exists('geoip_country_code_by_name')) { $this->gi = 'NOGI'; // We are using embedded php geoip functions //print 'function_exists(geoip_country_code_by_name))='.function_exists('geoip_country_code_by_name'); diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 28dbc0835e7..5f577421cae 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -2322,7 +2322,7 @@ class EmailCollector extends CommonObject 'class' => 'compta/facture/class/facture.class.php', 'object' => 'Facture'), 'fournisseur/facture' => array('table' => 'facture_fourn', - 'fields' => array('ref', ref_client), + 'fields' => array('ref', 'ref_client'), 'class' => 'fourn/class/fournisseur.facture.class.php', 'object' => 'FactureFournisseur'), 'produit' => array('table' => 'product', diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index bcfb1b83d6e..46701a459a6 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -77,7 +77,7 @@ class MailmanSpip */ public function isSpipEnabled() { - if (defined("ADHERENT_USE_SPIP") && (ADHERENT_USE_SPIP == 1)) { + if (getDolGlobalInt("ADHERENT_USE_SPIP") == 1) { return true; } @@ -91,10 +91,8 @@ class MailmanSpip */ public function checkSpipConfig() { - if (defined('ADHERENT_SPIP_SERVEUR') && defined('ADHERENT_SPIP_USER') && defined('ADHERENT_SPIP_PASS') && defined('ADHERENT_SPIP_DB')) { - if (ADHERENT_SPIP_SERVEUR != '' && ADHERENT_SPIP_USER != '' && ADHERENT_SPIP_PASS != '' && ADHERENT_SPIP_DB != '') { - return true; - } + if (getDolGlobalString('ADHERENT_SPIP_SERVEUR') != '' && getDolGlobalString('ADHERENT_SPIP_USER') != '' && getDolGlobalString('ADHERENT_SPIP_PASS') != '' && getDolGlobalString('ADHERENT_SPIP_DB') != '') { + return true; } return false; diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 75a929f53e5..b4da53f4635 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -781,9 +781,7 @@ class FormProduct */ public function selectLotDataList($htmlname = 'batch_id', $empty = 0, $fk_product = 0, $fk_entrepot = 0, $objectLines = array()) { - global $conf, $langs; - - dol_syslog(get_class($this)."::selectLotDataList $htmlname, $empty, $fk_product, $fk_entrepot,$objectLines", LOG_DEBUG); + dol_syslog(get_class($this)."::selectLotDataList $htmlname, $empty, $fk_product, $fk_entrepot", LOG_DEBUG); $out = ''; $productIdArray = array(); @@ -817,7 +815,7 @@ class FormProduct if (empty($fk_entrepot) || $fk_entrepot == $arraytypes['entrepot_id']) { $label = $arraytypes['entrepot_label'] . ' - '; $label .= $arraytypes['batch']; - $out .= ''; + $out .= ''; } } } diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 78cd5c8401b..09e6f4b6eaa 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -574,11 +574,11 @@ if (empty($reshook)) { if (!empty($object->email) && !isValidEMail($object->email)) { $langs->load("errors"); $error++; - setEventMessages('', $langs->trans("ErrorBadEMail", $object->email), 'errors'); + setEventMessages($langs->trans("ErrorBadEMail", $object->email), null, 'errors'); } if (!empty($object->url) && !isValidUrl($object->url)) { $langs->load("errors"); - setEventMessages('', $langs->trans("ErrorBadUrl", $object->url), 'errors'); + setEventMessages($langs->trans("ErrorBadUrl", $object->url), null, 'errors'); } if (!empty($object->webservices_url)) { //Check if has transport, without any the soap client will give error diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 25eeec6430f..bf46b063e64 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -962,7 +962,7 @@ function getListOfProductsOrServices($authentication, $filterproduct) * Get list of products for a category * * @param array $authentication Array of authentication information - * @param array $id Category id + * @param int $id Category id * @param Translate $lang Force lang * @return array Array result */