diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index bd3a3aeb360..71702c7b507 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -7,7 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -272,7 +272,7 @@ if ($action == 'add') $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; - $object->duree=((float) (GETPOST('dureehour') * 60) + (float) GETPOST('dureemin')) * 60; + $object->duree=(((int) GETPOST('dureehour') * 60) + (int) GETPOST('dureemin')) * 60; $transparency=(GETPOST("transparency")=='on'?1:0); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index d4f26a377b5..f7ec3beccc4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -45,7 +45,7 @@ if (empty($objectclass) || empty($uploaddir)) // Mass actions. Controls on number of lines checked. $maxformassaction=(empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS)?1000:$conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS); -if (! empty($massaction) && count($toselect) < 1) +if (! empty($massaction) && is_array($toselect) && count($toselect) < 1) { $error++; setEventMessages($langs->trans("NoRecordSelected"), null, "warnings"); diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 531b90b75e3..c6bc31956d6 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -469,7 +469,7 @@ function actions_prepare_head($object) $head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=action&element_id='.$object->id; $listofresourcelinked = $resource->getElementResources($object->element, $object->id); - $nbResources=count($listofresourcelinked); + $nbResources=(is_array($listofresourcelinked)?count($listofresourcelinked):0); $head[$h][1] = $langs->trans("Resources"); if ($nbResources > 0) $head[$h][1].= ' '.($nbResources).''; $head[$h][2] = 'resources'; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index f38b8fb10e0..79dcf6d120d 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1647,11 +1647,11 @@ elseif ($id > 0 || ! empty($ref)) } // create intervention model - if ($object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0) && $conf->global->MAIN_FEATURES_LEVEL >= 2) { + if ($conf->global->MAIN_FEATURE_LEVEL >=2 && $object->statut == Fichinter::STATUS_DRAFT && $user->rights->ficheinter->creer && (count($object->lines) > 0)) { print ''; }