From b0c3c9cd1718db21fe3928a8359dd0f073d7d0f8 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 30 Nov 2021 11:00:17 -0800 Subject: [PATCH] Fixes #4624 - Fall back to require() when loading legacy template if require_once() returns nothing (likely due to third-party plugin) or theme. --- signup.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/signup.php b/signup.php index 2a72f1322..c492dc853 100644 --- a/signup.php +++ b/signup.php @@ -97,11 +97,21 @@ if($template = e107::getCoreTemplate('signup')) } else { - require_once(e107::coreTemplatePath('signup')); //correct way to load a core template. + $SIGNUP_EXTENDED_USER_FIELDS = ''; + $SIGNUP_EXTENDED_CAT = ''; + + $tmplPath = e107::coreTemplatePath('signup'); + require_once($tmplPath); //correct way to load a core template. + if(empty($SIGNUP_BODY) && empty($SIGNUP_BEGIN)) // fall-back in case the template has been loaded before. + { + require($tmplPath); + } $template = array( 'extended-user-fields' => $SIGNUP_EXTENDED_USER_FIELDS, 'extended-category' => $SIGNUP_EXTENDED_CAT ); + unset($tmplPath); + } $signup_shortcodes = e107::getScBatch('signup');