issue 160, prevent session close error when use db session

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9266 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-22 02:43:53 +00:00
parent 88e59bc265
commit bd97f313b1

View file

@ -42,9 +42,18 @@
$this->entry = Context::convertEncodingStr(Context::get('entry'));
// Validate variables to prevent XSS
if($this->module && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->module)) die(Context::getLang("msg_invalid_request"));
if($this->mid && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->mid)) die(Context::getLang("msg_invalid_request"));
if($this->act && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->act)) die(Context::getLang("msg_invalid_request"));
$isInvalid = null;
if($this->module && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->module)) $isInvalid = true;
if($this->mid && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->mid)) $isInvalid = true;
if($this->act && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->act)) $isInvalid = true;
if ($isInvalid)
{
htmlHeader();
echo Context::getLang("msg_invalid_request");
htmlFooter();
Context::close();
exit;
}
// execute addon (before module initialization)
$called_position = 'before_module_init';