GET 일 경우에만 404 에러를 내도록 수정

This commit is contained in:
conory 2016-03-11 22:19:04 +09:00
parent 67cc800f28
commit 8cbc379280

View file

@ -170,12 +170,19 @@ class ModuleHandler extends Handler
{ {
$module_info = $oModuleModel->getModuleInfoByDocumentSrl($this->document_srl); $module_info = $oModuleModel->getModuleInfoByDocumentSrl($this->document_srl);
// redirect, if the document does not exist // If the document does not exist, remove document_srl
if(!$module_info) if(!$module_info)
{ {
$this->error = 'The document does not exist'; if(Context::getRequestMethod() == 'GET')
$this->httpStatusCode = '404'; {
return true; $this->error = 'The document does not exist';
$this->httpStatusCode = '404';
return true;
}
else
{
unset($this->document_srl);
}
} }
else else
{ {
@ -471,7 +478,6 @@ class ModuleHandler extends Handler
// If there is no such action in the module object // If there is no such action in the module object
if(!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act)) if(!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act))
{ {
if(!Context::isInstalled()) if(!Context::isInstalled())
{ {
self::_setInputErrorToContext(); self::_setInputErrorToContext();
@ -766,10 +772,6 @@ class ModuleHandler extends Handler
} }
self::_setInputValueToSession(); self::_setInputValueToSession();
} }
else
{
}
if($error != 0) if($error != 0)
{ {
@ -945,13 +947,11 @@ class ModuleHandler extends Handler
if($layout_srl && !$oModule->getLayoutFile()) if($layout_srl && !$oModule->getLayoutFile())
{ {
// If layout_srl exists, get information of the layout, and set the location of layout_path/ layout_file // If layout_srl exists, get information of the layout, and set the location of layout_path/ layout_file
$oLayoutModel = getModel('layout'); $oLayoutModel = getModel('layout');
$layout_info = $oLayoutModel->getLayout($layout_srl); $layout_info = $oLayoutModel->getLayout($layout_srl);
if($layout_info) if($layout_info)
{ {
// Input extra_vars into $layout_info // Input extra_vars into $layout_info
if($layout_info->extra_var_count) if($layout_info->extra_var_count)
{ {