mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +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()
|
||||
{
|
||||
// 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.
|
||||
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);
|
||||
if (!in_array($page_type_name, ['widget', 'article', 'outside']))
|
||||
{
|
||||
$page_type_name = 'widget';
|
||||
}
|
||||
$method = '_get' . ucfirst($page_type_name) . 'Content';
|
||||
if(method_exists($this, $method))
|
||||
{
|
||||
$page_content = $this->{$method}();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Rhymix\Framework\Exception(sprintf('%s method is not exists', $method));
|
||||
}
|
||||
$page_content = $this->{$method}();
|
||||
|
||||
Context::set('module_info', $this->module_info);
|
||||
Context::set('page_content', $page_content);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue