diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index af5671437ae..54090cf2fc6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10563,7 +10563,7 @@ function isAFileWithExecutableContent($filename) */ function newToken() { - return $_SESSION['newtoken']; + return !empty($_SESSION['newtoken']) ? $_SESSION['newtoken'] : ""; } /** diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 97199614ece..8205696751b 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -27,6 +27,11 @@ include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; +$website = null; +$websitepage = null; +$weblangs = null; +$pagelangs = null; + // Detection browser (copy of code from main.inc.php) if (isset($_SERVER["HTTP_USER_AGENT"]) && is_object($conf) && empty($conf->browser->name)) { $tmp = getBrowserInfo($_SERVER["HTTP_USER_AGENT"]); @@ -68,7 +73,7 @@ if ($pageid > 0) { $weblangs->setDefaultLang(GETPOSTISSET('lang') ? GETPOST('lang', 'aZ09') : (empty($_COOKIE['weblangs-shortcode']) ? 'auto' : preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['weblangs-shortcode']))); $pagelangs->setDefaultLang($websitepage->lang ? $websitepage->lang : $weblangs->shortlang); - if (!defined('USEDOLIBARREDITOR') && (in_array($websitepage->type_container, array('menu', 'other')) || empty($websitepage->status))) { + if (!defined('USEDOLIBARREDITOR') && (in_array($websitepage->type_container, array('menu', 'other')) || empty($websitepage->status) && !defined('USEDOLIBARRSERVER'))) { $weblangs->load("website"); http_response_code(404); print '


'.$weblangs->trans("YouTryToAccessToAFileThatIsNotAWebsitePage", $websitepage->pageurl, $websitepage->type_container, $websitepage->status).'
'; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ee279343a6f..d916d0a0e5f 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2520,6 +2520,7 @@ $form = new Form($db); $formadmin = new FormAdmin($db); $formwebsite = new FormWebsite($db); $formother = new FormOther($db); +$formconfirm = ""; // Confirm generation of website sitemaps if ($action == 'confirmgeneratesitemaps') { @@ -3040,7 +3041,7 @@ if (!GETPOST('hide_websitemenu')) { print ''."\n"; print '