From 689b31f87dc169466ff8a8f5b04c8ae3267757ef Mon Sep 17 00:00:00 2001 From: plegall Date: Fri, 29 Sep 2023 18:17:23 +0200 Subject: [PATCH] issue #2001 set useless but required template variables in popuphelp --- admin/popuphelp.php | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/admin/popuphelp.php b/admin/popuphelp.php index a4dd88a02..c7d24b598 100644 --- a/admin/popuphelp.php +++ b/admin/popuphelp.php @@ -20,11 +20,27 @@ include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); // +-----------------------------------------------------------------------+ check_status(ACCESS_ADMINISTRATOR); -$page['body_id'] = 'thePopuphelpPage'; -$title = l10n('Piwigo Help'); -$page['page_banner'] = '

'.$title.'

'; -$page['meta_robots']=array('noindex'=>1, 'nofollow'=>1); -include(PHPWG_ROOT_PATH.'include/page_header.php'); +if (!isset($_GET['output']) or 'content_only' != $_GET['output']) +{ + // Note on 2023-09-28 : calling popuphelp.php without output=content_only no longer occurs in Piwigo core. + $page['body_id'] = 'thePopuphelpPage'; + $title = l10n('Piwigo Help'); + $page['page_banner'] = '

'.$title.'

'; + $page['meta_robots']=array('noindex'=>1, 'nofollow'=>1); + + // set required template variables to avoid "Undefined array key" with PHP 8 + $template->assign( + array( + 'U_RETURN' => '', + 'USERNAME' => '', + 'U_FAQ'=> '', + 'U_CHANGE_THEME' => '', + 'U_LOGOUT' => '', + ) + ); + + include(PHPWG_ROOT_PATH.'include/page_header.php'); +} if (