From 0d0da234b1c71bb068aea6cde15ff653a771f90e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 16 Apr 2018 13:51:16 +0200 Subject: [PATCH] Lowercase NULL, TRUE, FALSE according to PSR2 --- .../class/PSWebServiceLibrary.class.php | 6 ++-- htdocs/admin/tools/export.php | 2 +- htdocs/api/class/api_setup.class.php | 2 +- htdocs/cashdesk/class/Facturation.class.php | 32 +++++++++---------- .../categories/class/api_categories.class.php | 4 +-- .../action/class/api_agendaevents.class.php | 4 +-- .../comm/propal/class/api_proposals.class.php | 8 ++--- htdocs/commande/class/api_orders.class.php | 8 ++--- htdocs/commande/class/commande.class.php | 2 +- .../facture/class/api_invoices.class.php | 8 ++--- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/contrat/class/api_contracts.class.php | 12 +++---- htdocs/core/actions_sendmails.inc.php | 4 +-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/cookie.class.php | 2 +- htdocs/core/class/dolgraph.class.php | 4 +-- htdocs/core/class/fileupload.class.php | 2 +- htdocs/core/class/ldap.class.php | 2 +- htdocs/core/class/rssparser.class.php | 2 +- htdocs/core/class/smtps.class.php | 6 ++-- .../connectors/php/commands.php | 6 ++-- htdocs/core/js/lib_foot.js.php | 2 +- htdocs/core/js/lib_gravatar.js.php | 2 +- htdocs/core/js/lib_head.js.php | 2 +- htdocs/core/js/lib_notification.js.php | 24 +++++++------- htdocs/core/js/timepicker.js.php | 2 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 4 +-- htdocs/core/lib/geturl.lib.php | 4 +-- htdocs/dav/dav.class.php | 2 +- .../expedition/class/api_shipments.class.php | 8 ++--- .../class/api_expensereports.class.php | 8 ++--- .../class/api_interventions.class.php | 4 +-- .../class/api_supplier_invoices.class.php | 4 +-- .../fourn/class/api_supplier_orders.class.php | 4 +-- .../fourn/class/fournisseur.facture.class.php | 2 +- htdocs/install/step1.php | 2 +- htdocs/loan/calc.php | 6 ++-- htdocs/main.inc.php | 6 ++-- .../template/class/api_mymodule.class.php | 4 +-- .../template/css/mymodule.css.php | 2 +- htdocs/paypal/lib/paypal.lib.php | 6 ++-- htdocs/product/class/api_products.class.php | 4 +-- .../stock/class/api_stockmovements.class.php | 4 +-- .../stock/class/api_warehouses.class.php | 4 +-- htdocs/projet/class/api_projects.class.php | 8 ++--- htdocs/projet/class/api_tasks.class.php | 8 ++--- htdocs/societe/class/api_contacts.class.php | 6 ++-- .../societe/class/api_thirdparties.class.php | 4 +-- htdocs/stripe/class/stripe.class.php | 4 +-- htdocs/stripe/payment.php | 2 +- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 2 +- htdocs/ticketsup/css/styles.css.php | 2 +- htdocs/user/class/api_users.class.php | 4 +-- htdocs/user/passwordforgotten.php | 2 +- 56 files changed, 138 insertions(+), 138 deletions(-) diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 10653df9dc0..de3ca683519 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -118,9 +118,9 @@ class PrestaShopWebservice public function executeRequest($url, $curl_params = array()) { $defaultParams = array( - CURLOPT_HEADER => TRUE, - CURLOPT_RETURNTRANSFER => TRUE, - CURLINFO_HEADER_OUT => TRUE, + CURLOPT_HEADER => true, + CURLOPT_RETURNTRANSFER => true, + CURLINFO_HEADER_OUT => true, CURLOPT_HTTPAUTH => CURLAUTH_BASIC, CURLOPT_USERPWD => $this->key.':', CURLOPT_HTTPHEADER => array( 'Expect:' ) diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index 01ab314df73..de9ccb2c048 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -280,7 +280,7 @@ function backup_tables($outputfile, $tables='*') //cycle through $handle = fopen($outputfile, 'w+'); - if (fwrite($handle, '') === FALSE) + if (fwrite($handle, '') === false) { $langs->load("errors"); dol_syslog("Failed to open file ".$outputfile,LOG_ERR); diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 22c763100d4..19bf6688638 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -170,7 +170,7 @@ class Setup extends DolibarrApi // and then apply the filter if there is one. $this->translateLabel($country, $lang); - if (empty($filter) || stripos($country->label, $filter) !== FALSE) { + if (empty($filter) || stripos($country->label, $filter) !== false) { $list[] = $this->_cleanObjectDatas($country); } } diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 769a69a23fa..a0e992e9da9 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -292,7 +292,7 @@ class Facturation else if ( $aId == 'RESET' ) { - $this->id = NULL; + $this->id = null; } else @@ -318,7 +318,7 @@ class Facturation } else if ( $aRef == 'RESET' ) { - $this->ref = NULL; + $this->ref = null; } else { @@ -342,7 +342,7 @@ class Facturation else if ( $aQte == 'RESET' ) { - $this->qte = NULL; + $this->qte = null; } else { @@ -366,7 +366,7 @@ class Facturation } else if ( $aStock == 'RESET' ) { - $this->stock = NULL; + $this->stock = null; } else { @@ -390,7 +390,7 @@ class Facturation } else if ($aRemisePercent == 'RESET') { - $this->remise_percent = NULL; + $this->remise_percent = null; } else { @@ -414,7 +414,7 @@ class Facturation } else if ( $aMontantRemise == 'RESET' ) { - $this->montant_remise = NULL; + $this->montant_remise = null; } else { @@ -439,7 +439,7 @@ class Facturation } else if ( $aPrix == 'RESET' ) { - $this->prix = NULL; + $this->prix = null; } else { @@ -463,7 +463,7 @@ class Facturation } else if ( $aTva == 'RESET' ) { - $this->tva = NULL; + $this->tva = null; } else { @@ -487,7 +487,7 @@ class Facturation } else if ( $aNumFacture == 'RESET' ) { - $this->num_facture = NULL; + $this->num_facture = null; } else { @@ -511,7 +511,7 @@ class Facturation } else if ( $aModeReglement == 'RESET' ) { - $this->mode_reglement = NULL; + $this->mode_reglement = null; } else { @@ -536,7 +536,7 @@ class Facturation } else if ( $aMontantEncaisse == 'RESET' ) { - $this->montant_encaisse = NULL; + $this->montant_encaisse = null; } else { @@ -560,7 +560,7 @@ class Facturation return $this->montant_rendu; } else if ( $aMontantRendu == 'RESET' ) { - $this->montant_rendu = NULL; + $this->montant_rendu = null; } else { @@ -584,7 +584,7 @@ class Facturation } else if ( $aPaiementLe == 'RESET' ) { - $this->paiement_le = NULL; + $this->paiement_le = null; } else { @@ -607,7 +607,7 @@ class Facturation } else if ( $aTotalHt == 'RESET' ) { - $this->prix_total_ht = NULL; + $this->prix_total_ht = null; } else { @@ -630,7 +630,7 @@ class Facturation } else if ( $aMontantTva == 'RESET' ) { - $this->montant_tva = NULL; + $this->montant_tva = null; } else { @@ -654,7 +654,7 @@ class Facturation } else if ( $aTotalTtc == 'RESET' ) { - $this->prix_total_ttc = NULL; + $this->prix_total_ttc = null; } else { diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php index 46332f9f979..c559d760f0f 100644 --- a/htdocs/categories/class/api_categories.class.php +++ b/htdocs/categories/class/api_categories.class.php @@ -172,7 +172,7 @@ class Categories extends DolibarrApi * @param array $request_data Request data * @return int ID of category */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->categorie->creer) { throw new RestException(401); @@ -197,7 +197,7 @@ class Categories extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->categorie->creer) { throw new RestException(401); diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index b507d9c72b9..f5d9c7db762 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -187,7 +187,7 @@ class AgendaEvents extends DolibarrApi * @param array $request_data Request data * @return int ID of Agenda Event */ - function post($request_data = NULL) + function post($request_data = null) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insuffisant rights to create your Agenda Event"); @@ -226,7 +226,7 @@ class AgendaEvents extends DolibarrApi * @return int */ /* - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insuffisant rights to create your Agenda Event"); } diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index 63b26373f60..d153489dcc8 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -176,7 +176,7 @@ class Proposals extends DolibarrApi * @param array $request_data Request data * @return int ID of proposal */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401, "Insuffisant rights"); @@ -241,7 +241,7 @@ class Proposals extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); @@ -307,7 +307,7 @@ class Proposals extends DolibarrApi * * @return object */ - function putLine($id, $lineid, $request_data = NULL) + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); @@ -410,7 +410,7 @@ class Proposals extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->propal->creer) { throw new RestException(401); } diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index cbd505a41b8..c0e494a1684 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -179,7 +179,7 @@ class Orders extends DolibarrApi * @param array $request_data Request data * @return int ID of order */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401, "Insuffisant rights"); @@ -245,7 +245,7 @@ class Orders extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } @@ -308,7 +308,7 @@ class Orders extends DolibarrApi * * @return object */ - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } @@ -402,7 +402,7 @@ class Orders extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->commande->creer) { throw new RestException(401); } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 0c63da5d4c2..a38cc3a442d 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -823,7 +823,7 @@ class Commande extends CommonOrder $line = $this->lines[$i]; // Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array - //if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object. + //if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object. if (! is_object($line)) $line = (object) $line; // Reset fk_parent_line for no child products and special product diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a114829d43c..f3aab82422f 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -196,7 +196,7 @@ class Invoices extends DolibarrApi * @param array $request_data Request datas * @return int ID of invoice */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401, "Insuffisant rights"); @@ -313,7 +313,7 @@ class Invoices extends DolibarrApi * @throws 401 * @throws 404 */ - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); } @@ -414,7 +414,7 @@ class Invoices extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); @@ -499,7 +499,7 @@ class Invoices extends DolibarrApi * @throws 404 * @throws 400 */ - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->facture->creer) { throw new RestException(401); } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index a06c1ccfa20..53e6ed99469 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -613,7 +613,7 @@ class Facture extends CommonInvoice $line = $this->lines[$i]; // Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array - //if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object. + //if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object. if (! is_object($line)) $line = (object) $line; if ($result >= 0) diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 689b0465fd4..1bb17eb4352 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -182,7 +182,7 @@ class Contracts extends DolibarrApi * @param array $request_data Request data * @return int ID of contrat */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401, "Insuffisant rights"); @@ -247,7 +247,7 @@ class Contracts extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -300,7 +300,7 @@ class Contracts extends DolibarrApi * * @return object */ - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -359,7 +359,7 @@ class Contracts extends DolibarrApi * * @return object */ - function activateLine($id, $lineid, $datestart, $dateend = NULL, $comment = NULL) { + function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -396,7 +396,7 @@ class Contracts extends DolibarrApi * * @return object */ - function unactivateLine($id, $lineid, $datestart, $comment = NULL) { + function unactivateLine($id, $lineid, $datestart, $comment = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } @@ -470,7 +470,7 @@ class Contracts extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index f1ab9305a4d..fde845f6af1 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -347,9 +347,9 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO if (!$folder) $folder = "Sent"; // Default Sent folder $mailboxconfig->mbox = imap_open($mailboxconfig->get_connector_url().$folder, $mailboxconfig->mailbox_imap_login, $mailboxconfig->mailbox_imap_password); - if (FALSE === $mailboxconfig->mbox) + if (false === $mailboxconfig->mbox) { - $info = FALSE; + $info = false; $err = $langs->trans('Error3_Imap_Connection_Error'); setEventMessages($err,$mailboxconfig->element, null, 'errors'); } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index addb7a98b80..9225fbe10ae 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6644,7 +6644,7 @@ abstract class CommonObject { $this->{$field} = @unserialize($obj->{$field}); // Hack for data not in UTF8 - if($this->{$field } === FALSE) @unserialize(utf8_decode($obj->{$field})); + if($this->{$field } === false) @unserialize(utf8_decode($obj->{$field})); } elseif($this->isInt($info)) { diff --git a/htdocs/core/class/cookie.class.php b/htdocs/core/class/cookie.class.php index 1d28861a44e..c41077f76fb 100644 --- a/htdocs/core/class/cookie.class.php +++ b/htdocs/core/class/cookie.class.php @@ -50,7 +50,7 @@ class DolCookie */ function __construct($key = '') { - $this->_myKey = hash('sha256', $key, TRUE); + $this->_myKey = hash('sha256', $key, true); $this->_iv = md5(md5($this->_myKey)); $this->cookie = ""; $this->myCookie = ""; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ba7a67be3cb..3ad22f87c03 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -674,7 +674,7 @@ class DolGraph $group->setPadding($paddleft, $paddright); // Width on left and right for Y axis values $group->legend->setSpace(0); $group->legend->setPadding(2,2,2,2); - $group->legend->setPosition(NULL,0.1); + $group->legend->setPosition(null, 0.1); $group->legend->setBackgroundColor($colorsemitrans); if (is_array($this->bgcolorgrid)) $group->grid->setBackgroundColor($bgcolorgrid); @@ -734,7 +734,7 @@ class DolGraph $plot->barShadow->setSize($this->SetShading); $plot->barShadow->setPosition(SHADOW_RIGHT_TOP); $plot->barShadow->setColor(new Color(160, 160, 160, 50)); - $plot->barShadow->smooth(TRUE); + $plot->barShadow->smooth(true); //$plot->setSize(1, 0.96); //$plot->setCenter(0.5, 0.52); diff --git a/htdocs/core/class/fileupload.class.php b/htdocs/core/class/fileupload.class.php index 648f1295c25..c3a40599877 100644 --- a/htdocs/core/class/fileupload.class.php +++ b/htdocs/core/class/fileupload.class.php @@ -225,7 +225,7 @@ class FileUpload * getFileObject * * @param string $file_name Filename - * @return stdClass|NULL + * @return stdClass|null */ protected function getFileObject($file_name) { diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 8fcdf53b4a6..f54caacff8b 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -502,7 +502,7 @@ class Ldap * @param string $newrdn New RDN entry key (uid=qqq) * @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb) * @param User $user Objet user that modify - * @param bool $deleteoldrdn If TRUE the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry. + * @param bool $deleteoldrdn If true the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry. * @return int <0 if KO, >0 if OK */ function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true) diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index 1d3af953375..32a5842d410 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -753,7 +753,7 @@ function xml2php($xml) { //If this element is already in the array we will create an indexed array $tmp = $array[$key]; - $array[$key] = NULL; + $array[$key] = null; $array[$key][] = $tmp; $array[$key][] = $child; $tab = true; diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index c4176d2b81b..f3e41d8d212 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -647,7 +647,7 @@ class SMTPs { /** * Returns constructed SELECT Object string or boolean upon failure - * Default value is set at TRUE + * Default value is set at true */ $_retVal = true; @@ -655,7 +655,7 @@ class SMTPs if ( ! empty ($_strConfigPath) ) { // If the path is not valid, this will NOT generate an error, - // it will simply return FALSE. + // it will simply return false. if ( ! @include ( $_strConfigPath ) ) { $this->_setErr(110, '"' . $_strConfigPath . '" is not a valid path.'); @@ -1756,7 +1756,7 @@ class SMTPs { /** * Returns constructed SELECT Object string or boolean upon failure - * Default value is set at TRUE + * Default value is set at true */ $_retVal = true; diff --git a/htdocs/core/filemanagerdol/connectors/php/commands.php b/htdocs/core/filemanagerdol/connectors/php/commands.php index 5523708a3a0..34e32fa5f99 100644 --- a/htdocs/core/filemanagerdol/connectors/php/commands.php +++ b/htdocs/core/filemanagerdol/connectors/php/commands.php @@ -24,7 +24,7 @@ /** * GetFolders - * + * * @param string $resourceType Resource type * @param string $currentFolder Current folder * @return void @@ -145,7 +145,7 @@ function CreateFolder( $resourceType, $currentFolder ) $sNewFolderName = $_GET['NewFolderName'] ; $sNewFolderName = SanitizeFolderName($sNewFolderName); - if (strpos($sNewFolderName, '..') !== FALSE) + if (strpos($sNewFolderName, '..') !== false) $sErrorNumber = '102' ; // Invalid folder name. else { @@ -187,7 +187,7 @@ function CreateFolder( $resourceType, $currentFolder ) //function FileUpload( $resourceType, $currentFolder, $sCommand ) /** * FileUpload - * + * * @param string $resourceType Resource type * @param string $currentFolder Current folder * @param string $sCommand Command diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index 0d8301c3b3b..a303f78eb15 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -32,7 +32,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; diff --git a/htdocs/core/js/lib_gravatar.js.php b/htdocs/core/js/lib_gravatar.js.php index bb850be8d5d..485a57ede88 100644 --- a/htdocs/core/js/lib_gravatar.js.php +++ b/htdocs/core/js/lib_gravatar.js.php @@ -33,7 +33,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php index 15dbc62ffa7..3f47e4da15d 100644 --- a/htdocs/core/js/lib_head.js.php +++ b/htdocs/core/js/lib_head.js.php @@ -35,7 +35,7 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; diff --git a/htdocs/core/js/lib_notification.js.php b/htdocs/core/js/lib_notification.js.php index ba725d3e226..6900e9b03e7 100644 --- a/htdocs/core/js/lib_notification.js.php +++ b/htdocs/core/js/lib_notification.js.php @@ -14,7 +14,7 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * + * * Library javascript to enable Browser notifications */ @@ -34,17 +34,17 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H global $langs, $conf; top_httphead('text/javascript; charset=UTF-8'); - + $nowtime = time(); //$nowtimeprevious = floor($nowtime / 60) * 60; // auto_check_events_not_before is rounded to previous minute // TODO Try to make a solution with only a javascript timer that is easier. Difficulty is to avoid notification twice when. /* session already started into main - session_cache_limiter(FALSE); + session_cache_limiter(false); header('Cache-Control: no-cache'); session_set_cookie_params(0, '/', null, false, true); // Add tag httponly on session cookie session_start();*/ - if (! isset($_SESSION['auto_check_events_not_before'])) + if (! isset($_SESSION['auto_check_events_not_before'])) { print 'console.log("_SESSION[auto_check_events_not_before] is not set");'."\n"; // Round to eliminate the seconds @@ -65,9 +65,9 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H /* Launch timer */ // We set a delay before launching first test so next check will arrive after the time_auto_update compared to previous one. var time_first_execution = (time_auto_update - (nowtime - time_js_next_test)) * 1000; //need milliseconds - if (login != '') { + if (login != '') { console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" auto_check_events_not_before (val in session)= "+auto_check_events_not_before+" time_js_next_test (max now,auto_check_events_not_before) = "+time_js_next_test+" time_auto_update="+time_auto_update); - setTimeout(first_execution, time_first_execution); + setTimeout(first_execution, time_first_execution); } //first run auto check @@ -88,13 +88,13 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H success: function (result) { var arr = JSON.parse(result); if (arr.length > 0) { - var audio = null; + var audio = null; global->AGENDA_REMINDER_BROWSER_SOUND)) { print 'audio = new Audio(\''.DOL_URL_ROOT.'/theme/common/sound/notification_agenda.wav'.'\');'; } ?> - + $.each(arr, function (index, value) { var url="notdefined"; var title="Not defined"; @@ -102,7 +102,7 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H if (value['type'] == 'agenda' && value['location'] != null && value['location'] != '') { body += '\n' + value['location']; } - + if (value['type'] == 'agenda') { url = '' + value['id']; @@ -113,10 +113,10 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H body: body, tag: value['id'] }; - + // We release the notify var noti = new Notification(title, extra); - if (index==0 && audio) + if (index==0 && audio) { audio.play(); } @@ -140,5 +140,5 @@ if (! ($_SERVER['HTTP_REFERER'] === $dolibarr_main_url_root . '/' || $_SERVER['H time_js_next_test += time_auto_update; console.log('Updated time_js_next_test. New value is '+time_js_next_test); } -open($inputfile); - if ($res === TRUE) + if ($res === true) { $zip->extractTo($outputdir.'/'); $zip->close(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index aa38af3c16d..fd3a2017a3d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -272,7 +272,7 @@ function GETPOSTISSET($paramname) * @param string $noreplace Force disable of replacement of __xxx__ strings. * @return string|string[] Value found (string or array), or '' if check fails */ -function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0) +function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0) { global $mysoc,$user,$conf; @@ -6519,7 +6519,7 @@ function dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensiti else { ($case_sensitive) ? natsort($temp) : natcasesort($temp); - if($order!='asc') $temp=array_reverse($temp,TRUE); + if($order!='asc') $temp=array_reverse($temp, true); } $sorted = array(); diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 2a45a71c4c9..418cc1418b5 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -65,8 +65,8 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea //curl_setopt($ch, CURLOPT_SSLVERSION, 6); for tls 1.2 //turning off the server and peer verification(TrustManager Concept). - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT); diff --git a/htdocs/dav/dav.class.php b/htdocs/dav/dav.class.php index 25f2ac8ccc7..9e5121112d0 100644 --- a/htdocs/dav/dav.class.php +++ b/htdocs/dav/dav.class.php @@ -244,7 +244,7 @@ class CdavLib * * @param int $calendarId Calendar id * @param int $bCalendarData Add calendar data - * @return array|string[][]|unknown[][]|NULL[][] + * @return array|string[][] */ public function getFullCalendarObjects($calendarId, $bCalendarData) { diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 9857b90c84c..844a6c95305 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -181,7 +181,7 @@ class Shipments extends DolibarrApi * @param array $request_data Request data * @return int ID of shipment */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401, "Insuffisant rights"); @@ -250,7 +250,7 @@ class Shipments extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401); } @@ -312,7 +312,7 @@ class Shipments extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401); } @@ -407,7 +407,7 @@ class Shipments extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if (! DolibarrApiAccess::$user->rights->expedition->creer) { throw new RestException(401); } diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index e68c9338b92..726aa158413 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -160,7 +160,7 @@ class ExpenseReports extends DolibarrApi * @param array $request_data Request data * @return int ID of Expense Report */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401, "Insuffisant rights"); @@ -228,7 +228,7 @@ class ExpenseReports extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } @@ -290,7 +290,7 @@ class ExpenseReports extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } @@ -380,7 +380,7 @@ class ExpenseReports extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->expensereport->creer) { throw new RestException(401); } diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php index 0d9360b0e72..8b21b534856 100644 --- a/htdocs/fichinter/class/api_interventions.class.php +++ b/htdocs/fichinter/class/api_interventions.class.php @@ -188,7 +188,7 @@ class Interventions extends DolibarrApi * @param array $request_data Request data * @return int ID of intervention */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { throw new RestException(401, "Insuffisant rights"); @@ -249,7 +249,7 @@ class Interventions extends DolibarrApi * * @return int */ - function postLine($id, $request_data = NULL) + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->ficheinter->creer) { throw new RestException(401, "Insuffisant rights"); diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index e60fdccd4ad..68bb902b8fb 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -182,7 +182,7 @@ class SupplierInvoices extends DolibarrApi * @param array $request_data Request datas * @return int ID of supplier invoice */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401, "Insuffisant rights"); @@ -218,7 +218,7 @@ class SupplierInvoices extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->facture->creer) { throw new RestException(401); diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php index 74b5bbe43b3..d9596bf3958 100644 --- a/htdocs/fourn/class/api_supplier_orders.class.php +++ b/htdocs/fourn/class/api_supplier_orders.class.php @@ -186,7 +186,7 @@ class SupplierOrders extends DolibarrApi * @param array $request_data Request datas * @return int ID of supplier order */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401, "Insuffisant rights"); @@ -222,7 +222,7 @@ class SupplierOrders extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->fournisseur->commande->creer) { throw new RestException(401); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 139792f3044..3f8fee2d5ad 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -404,7 +404,7 @@ class FactureFournisseur extends CommonInvoice $line = $this->lines[$i]; // Test and convert into object this->lines[$i]. When coming from REST API, we may still have an array - //if (! is_object($line)) $line=json_decode(json_encode($line), FALSE); // convert recursively array into object. + //if (! is_object($line)) $line=json_decode(json_encode($line), false); // convert recursively array into object. if (! is_object($line)) $line = (object) $line; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'facture_fourn_det (fk_facture_fourn)'; diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 62e27b1db33..f313a7a9595 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -878,7 +878,7 @@ function write_conf_file($conffile) $error=0; - $key = md5(uniqid(mt_rand(),TRUE)); // Generate random hash + $key = md5(uniqid(mt_rand(), true)); // Generate random hash $fp = fopen("$conffile", "w"); if($fp) diff --git a/htdocs/loan/calc.php b/htdocs/loan/calc.php index 434d57b43c2..fedf26e6a36 100644 --- a/htdocs/loan/calc.php +++ b/htdocs/loan/calc.php @@ -28,7 +28,7 @@ $default_sale_price = "150000"; $default_annual_interest_percent = 7.0; $default_year_term = 30; $default_down_percent = 10; -$default_show_progress = TRUE; +$default_show_progress = true; /* --------------------------------------------------- * * Initialize Variables @@ -241,7 +241,7 @@ if ($form_complete && $monthly_payment) print ''; print ''; */ - + print ''; print 'TOTAL Monthly Payment:'; print '' . number_format(($monthly_payment + $pmi_per_month + $residential_monthly_tax), "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . '
'; @@ -352,7 +352,7 @@ if ($form_complete && $show_progress) { print '' . number_format($remaining_balance, "2", ".", ",") . ' ' . $langs->trans("Currency".$conf->currency) . ''; print ''; - ($current_month % 12) ? $show_legend = FALSE : $show_legend = TRUE; + ($current_month % 12) ? ($show_legend = false) : ($show_legend = true); if ($show_legend) { print ''; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index f1d6487d5de..68fb0ce8d38 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -350,7 +350,7 @@ if (! defined('NOTOKENRENEWAL')) if (isset($_SESSION['newtoken'])) $_SESSION['token'] = $_SESSION['newtoken']; // Save in $_SESSION['newtoken'] what will be next token. Into forms, we will add param token = $_SESSION['newtoken'] - $token = dol_hash(uniqid(mt_rand(),TRUE)); // Generates a hash of a random number + $token = dol_hash(uniqid(mt_rand(), true)); // Generates a hash of a random number $_SESSION['newtoken'] = $token; } if ((! defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && ! empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) @@ -468,7 +468,7 @@ if (! defined('NOLOGIN')) if (GETPOST("username","alpha",2) && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { $sessionkey = 'dol_antispam_value'; - $ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); + $ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); // Check code if (! $ok) @@ -1502,7 +1502,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a { $toprightmenu.=$result; // For backward compatibility } - + // Link to module builder if (! empty($conf->modulebuilder->enabled)) { diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php index a068715b521..b4abf60861e 100644 --- a/htdocs/modulebuilder/template/class/api_mymodule.class.php +++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php @@ -192,7 +192,7 @@ class MyModuleApi extends DolibarrApi * * @url POST myobjects/ */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->myobject->create) { throw new RestException(401); @@ -218,7 +218,7 @@ class MyModuleApi extends DolibarrApi * * @url PUT myobjects/{id} */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->myobject->create) { throw new RestException(401); diff --git a/htdocs/modulebuilder/template/css/mymodule.css.php b/htdocs/modulebuilder/template/css/mymodule.css.php index b8b39dd6e8b..cd9a4b6035b 100644 --- a/htdocs/modulebuilder/template/css/mymodule.css.php +++ b/htdocs/modulebuilder/template/css/mymodule.css.php @@ -48,7 +48,7 @@ if (! $res) die("Include of main fails"); require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -session_cache_limiter(FALSE); +session_cache_limiter(false); // Load user to have $user->conf loaded (not done by default here because of NOLOGIN constant defined) and load permission if we need to use them in CSS /*if (empty($user->id) && ! empty($_SESSION['dol_login'])) diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index c34e964c522..4855799c508 100644 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -630,8 +630,8 @@ function hash_call($methodName,$nvpStr) curl_setopt($ch, CURLOPT_SSLVERSION, (empty($conf->global->PAYPAL_SSLVERSION)?1:$conf->global->PAYPAL_SSLVERSION)); //turning off the server and peer verification(TrustManager Concept). - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, empty($conf->global->MAIN_USE_CONNECT_TIMEOUT)?5:$conf->global->MAIN_USE_CONNECT_TIMEOUT); curl_setopt($ch, CURLOPT_TIMEOUT, empty($conf->global->MAIN_USE_RESPONSE_TIMEOUT)?30:$conf->global->MAIN_USE_RESPONSE_TIMEOUT); @@ -639,7 +639,7 @@ function hash_call($methodName,$nvpStr) curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_POST, 1); - //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled. + //if USE_PROXY constant set to true in Constants.php, then only proxy will be enabled. if ($USE_PROXY) { dol_syslog("Paypal API hash_call set proxy to ".$PROXY_HOST. ":" . $PROXY_PORT." - ".$PROXY_USER. ":" . $PROXY_PASS); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 516c67f1fbe..083aeb80e34 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -178,7 +178,7 @@ class Products extends DolibarrApi * @param array $request_data Request data * @return int ID of product */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->produit->creer) { throw new RestException(401); @@ -208,7 +208,7 @@ class Products extends DolibarrApi * @throws 401 * @throws 404 */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { global $conf; diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php index cb861f78575..16d21c02eb3 100644 --- a/htdocs/product/stock/class/api_stockmovements.class.php +++ b/htdocs/product/stock/class/api_stockmovements.class.php @@ -173,7 +173,7 @@ class StockMovements extends DolibarrApi * @return int ID of stock movement */ //function post($product_id, $warehouse_id, $qty, $lot='', $movementcode='', $movementlabel='', $price=0) - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); @@ -212,7 +212,7 @@ class StockMovements extends DolibarrApi * @return int */ /* - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index fd2dc4b2328..10b76d22a25 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -158,7 +158,7 @@ class Warehouses extends DolibarrApi * @param array $request_data Request data * @return int ID of warehouse */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); @@ -183,7 +183,7 @@ class Warehouses extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->stock->creer) { throw new RestException(401); diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index bf98938074d..ab157bf237c 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -179,7 +179,7 @@ class Projects extends DolibarrApi * @param array $request_data Request data * @return int ID of project */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401, "Insuffisant rights"); @@ -300,7 +300,7 @@ class Projects extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -362,7 +362,7 @@ class Projects extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -418,7 +418,7 @@ class Projects extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 81e28663cc4..3125546c10a 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -187,7 +187,7 @@ class Tasks extends DolibarrApi * @param array $request_data Request data * @return int ID of project */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401, "Insuffisant rights"); @@ -305,7 +305,7 @@ class Tasks extends DolibarrApi * @return int */ /* - function postLine($id, $request_data = NULL) { + function postLine($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -367,7 +367,7 @@ class Tasks extends DolibarrApi * @return object */ /* - function putLine($id, $lineid, $request_data = NULL) { + function putLine($id, $lineid, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } @@ -422,7 +422,7 @@ class Tasks extends DolibarrApi * * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->projet->creer) { throw new RestException(401); } diff --git a/htdocs/societe/class/api_contacts.class.php b/htdocs/societe/class/api_contacts.class.php index 3270bc144c2..508fe892ebe 100644 --- a/htdocs/societe/class/api_contacts.class.php +++ b/htdocs/societe/class/api_contacts.class.php @@ -194,7 +194,7 @@ class Contacts extends DolibarrApi * @param array $request_data Request datas * @return int ID of contact */ - function post($request_data = NULL) { + function post($request_data = null) { if (!DolibarrApiAccess::$user->rights->societe->contact->creer) { throw new RestException(401, 'No permission to create/update contacts'); @@ -219,7 +219,7 @@ class Contacts extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { if (!DolibarrApiAccess::$user->rights->societe->contact->creer) { throw new RestException(401, 'No permission to create/update contacts'); @@ -282,7 +282,7 @@ class Contacts extends DolibarrApi * * @url POST {id}/createUser */ - function createUser($id, $request_data = NULL) { + function createUser($id, $request_data = null) { //if (!DolibarrApiAccess::$user->rights->user->user->creer) { //throw new RestException(401); //} diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 1cdfabf7fca..73c782ddf7c 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -199,7 +199,7 @@ class Thirdparties extends DolibarrApi * @param array $request_data Request datas * @return int ID of thirdparty */ - function post($request_data = NULL) + function post($request_data = null) { if(! DolibarrApiAccess::$user->rights->societe->creer) { throw new RestException(401); @@ -223,7 +223,7 @@ class Thirdparties extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) + function put($id, $request_data = null) { if(! DolibarrApiAccess::$user->rights->societe->creer) { throw new RestException(401); diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 6ed703d7a92..2fbaa261665 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -334,10 +334,10 @@ class Stripe extends CommonObject $obj = $this->db->fetch_object($result); $key = $obj->fk_soc; } else { - $key = NULL; + $key = null; } } else { - $key = NULL; + $key = null; } $arrayzerounitcurrency=array('BIF', 'CLP', 'DJF', 'GNF', 'JPY', 'KMF', 'KRW', 'MGA', 'PYG', 'RWF', 'VND', 'VUV', 'XAF', 'XOF', 'XPF'); diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index 4eeae97ee71..0b124ea9929 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -418,7 +418,7 @@ else { } if (GETPOST('error')){ - setEventMessages(GETPOST('error'), NULL, 'errors'); + setEventMessages(GETPOST('error'), null, 'errors'); } if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paiement') diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b0c66ed1cb9..8577657204c 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -58,7 +58,7 @@ $fontsizesmaller='0.75em'; if (defined('THEME_ONLY_CONSTANT')) return; -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index da952125bf5..514f575d356 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -59,7 +59,7 @@ $fontsizesmaller='11'; if (defined('THEME_ONLY_CONSTANT')) return; -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/ticketsup/css/styles.css.php b/htdocs/ticketsup/css/styles.css.php index aed9b79cbc9..d52739d9dc0 100644 --- a/htdocs/ticketsup/css/styles.css.php +++ b/htdocs/ticketsup/css/styles.css.php @@ -31,7 +31,7 @@ if (! defined('NOLOGIN')) define('NOLOGIN',1); // File must be if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -session_cache_limiter(FALSE); +session_cache_limiter(false); require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php index c30cacd72c0..556b86332bc 100644 --- a/htdocs/user/class/api_users.class.php +++ b/htdocs/user/class/api_users.class.php @@ -162,7 +162,7 @@ class Users extends DolibarrApi * @param array $request_data New user data * @return int */ - function post($request_data = NULL) { + function post($request_data = null) { // check user authorization //if(! DolibarrApiAccess::$user->rights->user->creer) { // throw new RestException(401, "User creation not allowed"); @@ -194,7 +194,7 @@ class Users extends DolibarrApi * @param array $request_data Datas * @return int */ - function put($id, $request_data = NULL) { + function put($id, $request_data = null) { //if (!DolibarrApiAccess::$user->rights->user->user->creer) { //throw new RestException(401); //} diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index cde5c5199e0..584fa6f2427 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -96,7 +96,7 @@ if ($action == 'validatenewpassword' && $username && $passwordhash) if ($action == 'buildnewpassword' && $username) { $sessionkey = 'dol_antispam_value'; - $ok=(array_key_exists($sessionkey, $_SESSION) === TRUE && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); + $ok=(array_key_exists($sessionkey, $_SESSION) === true && (strtolower($_SESSION[$sessionkey]) == strtolower($_POST['code']))); // Verify code if (! $ok)