Merge branch 'rhymix:master' into master

This commit is contained in:
Lastorder 2025-03-10 17:04:17 +09:00 committed by GitHub
commit a40502885e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 259 additions and 140 deletions

View file

@ -317,13 +317,14 @@ class Context
$lang->loadDirectory(RX_BASEDIR . 'common/lang', 'common');
$lang->loadDirectory(RX_BASEDIR . 'modules/module/lang', 'module');
self::setLangType(self::$_instance->lang_type = $lang_type);
self::set('lang', self::$_instance->lang = $lang);
// Set global variables for backward compatibility.
$GLOBALS['oContext'] = self::$_instance;
$GLOBALS['__Context__'] = &self::$_user_vars;
$GLOBALS['_time_zone'] = config('locale.default_timezone');
$GLOBALS['lang'] = &$lang;
self::$_user_vars->lang = $lang;
self::$_instance->lang = $lang;
// set session handler
if(self::isInstalled() && config('session.use_db'))
@ -1488,9 +1489,18 @@ class Context
}
foreach($val as $_key => $_val)
{
if(is_array($_val))
if($is_array)
{
$_val = self::_filterRequestVar($key, $_val);
if(in_array($key, array('mid', 'vid', 'act', 'module')))
{
self::$_instance->security_check = 'DENY ALL';
self::$_instance->security_check_detail = 'ERR_UNSAFE_VAR';
$_val = null;
}
else
{
$_val = self::_filterRequestVar($key, $_val);
}
}
elseif($_val = trim($_val))
{

View file

@ -105,7 +105,7 @@ class HTMLDisplayHandler
'dispPageAdminMobileContentModify' => true,
'dispPageAdminMobileContent' => true,
);
$current_act = Context::get('act') ?? '';
$current_act = strval(Context::get('act'));
if(Context::get('module') != 'admin' && strpos($current_act, 'Admin') !== false && !isset($x_exclude_actions[$current_act]))
{
$output = '<div class="x">' . $output . '</div>';

View file

@ -88,11 +88,11 @@ class ModuleHandler extends Handler
// Set variables from request arguments
$this->method = Context::getRequestMethod();
$this->module = $module ? $module : Context::get('module');
$this->act = $act ? $act : Context::get('act');
$this->mid = $mid ? $mid : Context::get('mid');
$this->document_srl = $document_srl ? (int) $document_srl : (int) Context::get('document_srl');
$this->module_srl = $module_srl ? (int) $module_srl : (int) Context::get('module_srl');
$this->module = strval($module ?: Context::get('module'));
$this->act = strval($act ?: Context::get('act'));
$this->mid = strval($mid ?: Context::get('mid'));
$this->document_srl = intval($document_srl ?: Context::get('document_srl'));
$this->module_srl = intval($module_srl ?: Context::get('module_srl'));
$this->route = Context::getCurrentRequest() ?: new stdClass;
$this->is_mobile = Mobile::isFromMobilePhone();
if($entry = Context::get('entry'))
@ -156,7 +156,7 @@ class ModuleHandler extends Handler
$urls = array('success_return_url', 'error_return_url');
foreach($urls as $key)
{
$url = Context::get($key);
$url = strval(Context::get($key));
if ($url && !Rhymix\Framework\URL::isInternalURL($url))
{
Context::set($key, null);
@ -848,10 +848,15 @@ class ModuleHandler extends Handler
$seo_title = config('seo.subpage_title') ?: '$SITE_TITLE - $SUBPAGE_TITLE';
}
$seo_title = Context::replaceUserLang($seo_title);
$subpage_title = $module_info->browser_title;
if (in_array($module_info->module, ['member']))
{
$subpage_title = '';
}
Context::setBrowserTitle($seo_title, array(
'site_title' => Context::getSiteTitle(),
'site_subtitle' => Context::getSiteSubtitle(),
'subpage_title' => $module_info->browser_title,
'subpage_title' => $subpage_title,
'page' => Context::get('page') ?: 1,
));