From 7b29ce036a06325e464d39ff7c08af6e13103bac Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 00:50:30 +0200 Subject: [PATCH 1/6] Fix input of virtual host and canonical url --- htdocs/core/lib/website2.lib.php | 4 +++- htdocs/website/index.php | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 0ab35c55fd8..ce1f27b49fc 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -196,7 +196,9 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage) else dol_print_error($db); } // Add canonical reference - $tplcontent .= ''."\n"; + if ($object->virtualhost) { + $tplcontent .= ''."\n"; + } // Add manifest.json on homepage $tplcontent .= 'use_manifest) { print \'\'."\n"; } ?>'."\n"; $tplcontent .= ''."\n"; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 4f7cba09e89..70cfe780f55 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -681,6 +681,7 @@ if ($action == 'addcontainer') //$objectpage->htmlheader = preg_replace('/]*>\n/ims', '', $objectpage->htmlheader); + $objectpage->htmlheader = preg_replace('/]*rel="alternate[^>]*>\n/ims', '', $objectpage->htmlheader); $objectpage->htmlheader = preg_replace('/]*rel="canonical[^>]*>\n/ims', '', $objectpage->htmlheader); // Now loop to fetch JS @@ -1155,7 +1156,8 @@ if ($action == 'updatecss') if (GETPOSTISSET('virtualhost')) { - if (GETPOST('virtualhost', 'alpha') && !preg_match('/^http/', GETPOST('virtualhost', 'alpha'))) + $tmpvirtualhost = preg_replace('/\/$/', '', GETPOST('virtualhost', 'alpha')); + if ($tmpvirtualhost && !preg_match('/^http/', $tmpvirtualhost)) { $error++; setEventMessages($langs->trans('ErrorURLMustStartWithHttp', $langs->transnoentitiesnoconv("VirtualHost")), null, 'errors'); @@ -1169,7 +1171,7 @@ if ($action == 'updatecss') $arrayotherlang[$key] = substr(trim($val), 0, 2); // Kept short language code only } - $object->virtualhost = GETPOST('virtualhost', 'alpha'); + $object->virtualhost = $tmpvirtualhost; $object->lang = GETPOST('WEBSITE_LANG', 'aZ09'); $object->otherlang = join(',', $arrayotherlang); $object->use_manifest = GETPOST('use_manifest', 'alpha'); From d35a24ee76b0639d7b3697ba95e0149b053421fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 01:36:33 +0200 Subject: [PATCH 2/6] Removed not expected file --- htdocs/website/index.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 htdocs/website/index.html diff --git a/htdocs/website/index.html b/htdocs/website/index.html deleted file mode 100644 index e69de29bb2d..00000000000 From 3e187f8ce06325d0a4e3fca35205006640abe290 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 03:36:29 +0200 Subject: [PATCH 3/6] Fix add check on size limit --- htdocs/compta/prelevement/card.php | 4 ---- htdocs/website/index.php | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index cb3205a0e70..d81e101be3d 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -272,10 +272,6 @@ if ($id > 0 || $ref) print ''.$langs->trans("TransMetod").''; print $form->selectarray("methode", $object->methodes_trans); print ''; - /*print ''.$langs->trans("File").''; - print ''; - print '
'; - print '';*/ print '
'; print '
'; print ''; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 70cfe780f55..a48b6d92548 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3069,6 +3069,7 @@ if ($action == 'importsite') print ''.$langs->trans("ZipOfWebsitePackageToImport").'

'; + print ''; print ''; print ''; print ''; From b3a17c8da4550e620fd7e87c9a473d9c3ae09053 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 May 2020 04:21:38 +0200 Subject: [PATCH 4/6] Look and feel v12 --- htdocs/admin/security.php | 14 +++++++------- htdocs/admin/security_file.php | 4 ++-- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index f016c305a15..d9d61673c5e 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -168,9 +168,9 @@ elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') exit; } -if ($action == 'maj_pattern') +if ($action == 'updatepattern') { - $pattern = GETPOST("pattern"); + $pattern = GETPOST("pattern", "alpha"); $explodePattern = explode(';', $pattern); $patternInError = false; @@ -184,6 +184,7 @@ if ($action == 'maj_pattern') if (!$patternInError) { dolibarr_set_const($db, "USER_PASSWORD_PATTERN", $pattern, 'chaine', 0, '', $conf->entity); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: security.php"); exit; } @@ -336,11 +337,9 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { print ''; print '
'; - print ''; - print ''; - print '
'; + print '
'; print ''.$langs->trans("Save").''; - print '
'; + print ''; print '

'; print '