Browse Source

Fix warnings

Laurent Destailleur 1 year ago
parent
commit
dd073a07b1
3 changed files with 3 additions and 9 deletions
  1. 1 8
      htdocs/core/boxes/box_graph_propales_permonth.php
  2. 1 1
      htdocs/main.inc.php
  3. 1 0
      phpstan.neon

+ 1 - 8
htdocs/core/boxes/box_graph_propales_permonth.php

@@ -184,14 +184,7 @@ class box_graph_propales_permonth extends ModeleBoxes
 				//$datatype2 = array('lines','bars');
 
 				$filenamenb = $dir."/".$prefix."propalsamountinyear-".$endyear.".png";
-				if (!empty($mode)) {
-					if ($mode == 'customer') {
-						$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png';
-					}
-					if ($mode == 'supplier') {
-						$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstatssupplier&file=propalsamountinyear-'.$endyear.'.png';
-					}
-				}
+				$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=propalstats&file=propalsamountinyear-'.$endyear.'.png';
 
 				$px2 = new DolGraph();
 				$mesg = $px2->isGraphKo();

+ 1 - 1
htdocs/main.inc.php

@@ -560,7 +560,7 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && getDolGlobalInt(
 	// Check a token is provided for all cases that need a mandatory token
 	// (all POST actions + all sensitive GET actions + all mass actions + all login/actions/logout on pages with CSRFCHECK_WITH_TOKEN set)
 	if (
-		$_SERVER['REQUEST_METHOD'] == 'POST' ||
+		(!empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') ||
 		$sensitiveget ||
 		GETPOSTISSET('massaction') ||
 		((GETPOSTISSET('actionlogin') || GETPOSTISSET('action')) && defined('CSRFCHECK_WITH_TOKEN'))

+ 1 - 0
phpstan.neon

@@ -49,6 +49,7 @@ parameters:
 		- '#Undefined variable: \$error#'
 		- '#Undefined variable: \$errors#'
 		- '#Undefined variable: \$form#'
+		- '#has an unused parameter \$param#'
 		- '#Result of function fieldList#'
 		- '#Caught class Stripe#'
 		- '#Function llxHeader invoked with#'