mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 17:44:38 +09:00
Prevent '_getContent method is not exists' error when page info is improperly cached
This commit is contained in:
parent
d4a1be1ef0
commit
0272c5d27a
1 changed files with 10 additions and 9 deletions
|
|
@ -53,7 +53,10 @@ class pageView extends page
|
||||||
function dispPageIndex()
|
function dispPageIndex()
|
||||||
{
|
{
|
||||||
// Variables used in the template Context:: set()
|
// Variables used in the template Context:: set()
|
||||||
if($this->module_srl) Context::set('module_srl',$this->module_srl);
|
if ($this->module_srl)
|
||||||
|
{
|
||||||
|
Context::set('module_srl', $this->module_srl);
|
||||||
|
}
|
||||||
|
|
||||||
// Kick out anyone who tries to exploit RVE-2022-2.
|
// Kick out anyone who tries to exploit RVE-2022-2.
|
||||||
foreach (Context::getRequestVars() as $key => $val)
|
foreach (Context::getRequestVars() as $key => $val)
|
||||||
|
|
@ -64,16 +67,14 @@ class pageView extends page
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get page content according to page type.
|
||||||
$page_type_name = strtolower($this->module_info->page_type);
|
$page_type_name = strtolower($this->module_info->page_type);
|
||||||
|
if (!in_array($page_type_name, ['widget', 'article', 'outside']))
|
||||||
|
{
|
||||||
|
$page_type_name = 'widget';
|
||||||
|
}
|
||||||
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
||||||
if(method_exists($this, $method))
|
$page_content = $this->{$method}();
|
||||||
{
|
|
||||||
$page_content = $this->{$method}();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
throw new Rhymix\Framework\Exception(sprintf('%s method is not exists', $method));
|
|
||||||
}
|
|
||||||
|
|
||||||
Context::set('module_info', $this->module_info);
|
Context::set('module_info', $this->module_info);
|
||||||
Context::set('page_content', $page_content);
|
Context::set('page_content', $page_content);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue