merge from 1.5.3 (~r10951). required minify admin.min.js

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.3.1@10952 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-07-27 03:04:27 +00:00
commit d97822999e
34 changed files with 233 additions and 127 deletions

View file

@ -116,7 +116,7 @@ class CacheApc extends CacheBase {
* @return void
*/
function delete($key) {
$this->_delete($_key);
$this->_delete($key);
}
/**

View file

@ -847,19 +847,42 @@ class Context {
* @return mixed filtered value. Type are string or array
*/
function _filterRequestVar($key, $val, $do_stripslashes = 1) {
if( ($key == 'page' || $key == 'cpage' || substr($key,-3)=='srl')) return !preg_match('/^[0-9,]+$/',$val)?(int)$val:$val;
if($key == 'mid' || $key == 'vid' || $key == 'search_keyword') return htmlspecialchars($val);
if(is_array($val) && count($val) ) {
foreach($val as $k => $v) {
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc()) $v = stripslashes($v);
$v = trim($v);
$val[$k] = $v;
}
} else {
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc()) $val = stripslashes($val);
$val = trim($val);
$isArray = TRUE;
if(!is_array($val))
{
$isArray = FALSE;
$val = array($val);
}
foreach($val as $k => $v)
{
if($key === 'page' || $key === 'cpage' || substr($key, -3) === 'srl')
{
$val[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int)$v : $v;
}
elseif($key === 'mid' || $key === 'vid' || $key === 'search_keyword')
{
$val[$k] = htmlspecialchars($v);
}
else
{
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc())
{
$v = stripslashes($v);
}
$val[$k] = trim($v);
}
}
if($isArray)
{
return $val;
}
else
{
return $val[0];
}
return $val;
}
/**

View file

@ -582,7 +582,7 @@ class DBMysql extends DB {
$uses_groupby = $queryObject->getGroupByString() != '';
if($uses_distinct || $uses_groupby) {
$count_query = sprintf('select %s %s %s %s'
, $temp_select
, $temp_select == '*' ? '1' : $temp_select
, 'FROM ' . $queryObject->getFromString($with_values)
, ($temp_where === '' ? '' : ' WHERE '. $temp_where)
, ($uses_groupby ? ' GROUP BY ' . $queryObject->getGroupByString() : '')

View file

@ -175,7 +175,7 @@ class HTMLDisplayHandler {
switch($type){
case 'text':
case 'hidden':
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.htmlspecialchars($INPUT_ERROR[$match[3]]).'"';
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str).' value="'.@htmlspecialchars($INPUT_ERROR[$match[3]]).'"';
break;
case 'password':
$str = preg_replace('@\svalue="[^"]*?"@', ' ', $str);
@ -183,7 +183,7 @@ class HTMLDisplayHandler {
case 'radio':
case 'checkbox':
$str = preg_replace('@\schecked(="[^"]*?")?@', ' ', $str);
if(preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str)) {
if(@preg_match('@\s(?i:value)="'.$INPUT_ERROR[$match[3]].'"@', $str)) {
$str .= ' checked="checked"';
}
break;

View file

@ -212,7 +212,17 @@
if(!$this->act) {
$this->error = 'msg_module_is_not_exists';
$this->httpStatusCode = '404';
return;
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
$oMessageObject = &ModuleHandler::getModuleInstance('message',$type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if($this->httpStatusCode)
{
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
}
return $oMessageObject;
}
// get type, kind
@ -271,9 +281,16 @@
}
if(!is_object($oModule)) {
$this->error = 'msg_module_is_not_exists';
$this->httpStatusCode = '404';
return;
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
$oMessageObject = &ModuleHandler::getModuleInstance('message',$type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if($this->httpStatusCode)
{
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
}
return $oMessageObject;
}
// If there is no such action in the module object
@ -283,7 +300,15 @@
if(!Context::isInstalled())
{
$this->error = 'msg_invalid_request';
return;
$oMessageObject = &ModuleHandler::getModuleInstance('message',$type);
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
if($this->httpStatusCode)
{
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
}
return $oMessageObject;
}
$forward = null;
@ -369,7 +394,9 @@
else
{
$this->error = 'msg_invalid_request';
return;
$oModule->setError(-1);
$oModule->setMessage($this->error);
return $oModule;
}
}

View file

@ -61,12 +61,10 @@
{
$this->add('redirect_url', $url);
}
else
if($output !== NULL && is_object($output))
{
if($output !== NULL && is_object($output))
{
return $output;
}
return $output;
}
}
@ -153,7 +151,7 @@
$oModuleModel = &getModel('module');
// permission settings. access, manager(== is_admin) are fixed and privilege name in XE
$module_srl = Context::get('module_srl');
if(!$module_info->mid && preg_match('/^([0-9]+)$/',$module_srl)) {
if(!$module_info->mid && !is_array($module_srl) && preg_match('/^([0-9]+)$/',$module_srl)) {
$request_module = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
if($request_module->module_srl == $module_srl) {
$grant = $oModuleModel->getGrant($request_module, $logged_info);
@ -175,13 +173,15 @@
// Check permissions
switch($permission_target) {
case 'root' :
$this->stop('msg_not_permitted_act');
break;
case 'manager' :
if(!$grant->manager) $this->stop('msg_not_permitted_act');
break;
case 'manager' :
$this->stop('msg_not_permitted_act');
return;
case 'member' :
if(!$is_logged) $this->stop('msg_not_permitted_act');
if(!$is_logged)
{
$this->stop('msg_not_permitted_act');
return;
}
break;
}
}
@ -335,7 +335,8 @@
if(isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act)) {
// Check permissions
if($this->module_srl && !$this->grant->access){
return $this->stop("msg_not_permitted_act");
$this->stop("msg_not_permitted_act");
return FALSE;
}
// integrate skin information of the module(change to sync skin info with the target module only by seperating its table)
$oModuleModel = &getModel('module');

View file

@ -209,7 +209,7 @@ class TemplateHandler {
$buff = '<?php if(!defined("__XE__"))exit;?>'.$buff;
// remove php script reopening
$buff = preg_replace(array('/(\n|\r\n)+/','/(;)?( )*\?\>([\n\t ]+)?\<\?php([\n\t ]+)?/'),array("\n",";\n"),$buff);
$buff = preg_replace(array('/(\n|\r\n)+/','/(;)?( )*\?\>\<\?php([\n\t ]+)?/'),array("\n",";\n"),$buff);
return $buff;
}
@ -276,7 +276,7 @@ class TemplateHandler {
if(!preg_match('/no-error-return-url="true"/i', $matches[1]))
{
preg_match('/<input[^>]*name="error_return_url"[^>]*>/is', $matches[2], $m3);
if(!$m3[0]) $matches[2] = '<input type="hidden" name="error_return_url" value="<?php echo getRequestUriByServerEnviroment() ?>" />'.$matches[2];
if(!$m3[0]) $matches[2] = '<input type="hidden" name="error_return_url" value="<?php echo htmlspecialchars(getRequestUriByServerEnviroment()) ?>" />'.$matches[2];
}
else
{
@ -545,7 +545,7 @@ class TemplateHandler {
}
$result = "<?php {$result} ?>";
if(__DEBUG__) if($metafile) $result = "<!--#Meta:{$metafile}-->".$result;
if($metafile) $result = "<!--#Meta:{$metafile}-->".$result;
return $result;
}