From 31897f54ac24b267924f5ced5cc3ce0037daecd1 Mon Sep 17 00:00:00 2001 From: gauthier Date: Thu, 25 Apr 2019 12:37:05 +0200 Subject: [PATCH 01/34] Fix prev situation invoice selection (backport fix 8.0) --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 4efedc2544e..92a999463f8 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3242,7 +3242,7 @@ class Form if ($obj->situation_final != 1) { //Not prov? if (substr($obj->facnumber, 1, 4) != 'PROV') { - if ($selected == $obj->situation_final) { + if ($selected == $obj->rowid) { $opt .= ''; } else { $opt .= ''; From 9760ed5c8d04f4de446c9e76bb1543371e695fcf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Apr 2019 23:36:19 +0200 Subject: [PATCH 02/34] FIX CVE-2019-11199 --- htdocs/viewimage.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 2385a558307..073aaa9fb24 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -169,6 +169,9 @@ $type = 'application/octet-stream'; if (GETPOST('type','alpha')) $type=GETPOST('type','alpha'); else $type=dol_mimetype($original_file); +// Security: This wrapper is for images. We do not allow type/html +if (preg_match('/html/', $type)) accessforbidden('Error: Using the image wrapper to output a file with a mime type HTML is not possible.', 1, 1, 1); + // Security: Delete string ../ into $original_file $original_file = str_replace("../","/", $original_file); @@ -176,7 +179,7 @@ $original_file = str_replace("../","/", $original_file); $refname=basename(dirname($original_file)."/"); // Security check -if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart'); +if (empty($modulepart)) accessforbidden('Bad value for parameter modulepart', 1, 1, 1); $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $refname); $accessallowed = $check_access['accessallowed']; From 143cbec2816aabdae56b765c2428bcfc2533e9f2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Apr 2019 13:23:33 +0200 Subject: [PATCH 03/34] Fix test --- htdocs/projet/element.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 23ee7fd8e2d..c2ea95d14ca 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -474,7 +474,7 @@ $listofreferent=array( 'lang'=>'banks', 'buttonnew'=>'AddVariousPayment', 'testnew'=>$user->rights->banque->modifier, - 'test'=>$conf->banque->enabled && $user->rights->banque->lire), + 'test'=>$conf->banque->enabled && $user->rights->banque->lire && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)), /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( 'name'=>"Agenda", From c90dc13a21c949643f378e519315f1fdc261b14e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Apr 2019 13:02:52 +0200 Subject: [PATCH 04/34] CSS --- htdocs/theme/eldy/global.inc.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index f234ba319c2..38b05e30b9f 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5640,7 +5640,7 @@ div.tabsElem a.tab { /* nboftopmenuentries = , fontsize= */ /* rule to reduce top menu - 1st reduction: Reduce width of top menu icons */ -@media only screen and (max-width: px) /* reduction 1 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1) ? round($nbtopmenuentries * 90, 0) + 240 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC1; ?>px) /* reduction 1 */ { div.tmenucenter { width: px; /* size of viewport */ @@ -5673,7 +5673,7 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 2nd reduction: Reduce width of top menu icons again */ -@media only screen and (max-width: px) /* reduction 2 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2) ? round($nbtopmenuentries * 69, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC2; ?>px) /* reduction 2 */ { div.mainmenu { height: 23px; @@ -5697,7 +5697,7 @@ div.tabsElem a.tab { } } /* rule to reduce top menu - 3rd reduction: The menu for user is on left */ -@media only screen and (max-width: px) /* reduction 3 */ +@media only screen and (max-width: global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3) ? round($nbtopmenuentries * 47, 0) + 40 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */ { .side-nav { z-index: 200; From 15d57df1774a93012de7475aef945af2933f22a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 27 Apr 2019 13:03:11 +0200 Subject: [PATCH 05/34] CSS --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6ffd5a088e8..fa3a8c1cd43 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1813,7 +1813,7 @@ function top_menu_user(User $user, Translate $langs)