merge from 1.5.3.2(r11162 ~ r11201)

and from luminous (r11141 ~ r11193)

git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11202 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
devjin 2012-09-11 02:52:49 +00:00
parent 773a666d12
commit 42eb19ae10
32 changed files with 340 additions and 131 deletions

View file

@ -151,7 +151,17 @@
$this->mid = $module_info->mid;
$this->module_info = $module_info;
Context::setBrowserTitle($module_info->browser_title);
$part_config= $oModuleModel->getModulePartConfig('layout',$module_info->layout_srl);
if($module_info->use_mobile && Mobile::isFromMobilePhone())
{
$layoutSrl = $module_info->mlayout_srl;
}
else
{
$layoutSrl = $module_info->layout_srl;
}
$part_config= $oModuleModel->getModulePartConfig('layout',$layoutSrl);
Context::addHtmlHeader($part_config->header_script);
}

View file

@ -187,7 +187,7 @@ class TemplateHandler {
$buff = preg_replace('@<!--//.*?-->@s', '', $buff);
// replace value of src in img/input/script tag
$buff = preg_replace_callback('/<(?:img|input|script)(?:(?!["\'\/]\s*>).)* src="(?!https?:\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff);
$buff = preg_replace_callback('/<(?:img|input|script)[^<>]*src="(?!https?:\/\/|[\/\{])([^"]+)"/is', array($this, '_replacePath'), $buff);
// replace loop and cond template syntax
$buff = $this->_parseInline($buff);
@ -223,6 +223,7 @@ class TemplateHandler {
* @param array $matches
* @return string
**/
function _compileFormAuthGeneration($matches)
{
// form ruleset attribute move to hidden tag

View file

@ -163,11 +163,50 @@ class Argument {
* @return string
*/
function _escapeStringValue($value) {
// Remove non-utf8 chars.
$regex = <<<'END'
/
(
(?:
[\x00-\x7F] # single-byte sequences 0xxxxxxx
|[\xC0-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx
|[\xE0-\xEF][\x80-\xBF]{2} # triple-byte sequences 1110xxxx 10xxxxxx * 2
)+
)
|([\xF0-\xF7][\x80-\xBF]{3}) # quadruple-byte sequence 11110xxx 10xxxxxx * 3
|([\x80-\xBF]) # invalid byte in range 10000000 - 10111111
|([\xC0-\xFF]) # invalid byte in range 11000000 - 11111111
/x
END;
$value = preg_replace_callback($regex, array($this, 'utf8Replacer'), $value);
$db = &DB::getInstance();
$value = $db->addQuotes($value);
return '\'' . $value . '\'';
}
function utf8Replacer($captures) {
if (!empty($captures[1]))
{
// Valid byte sequence. Return unmodified.
return $captures[1];
}
elseif(!empty($captures[2]))
{
// Remove user defined area
if("\xF3\xB0\x80\x80" <= $captures[2])
{
return;
}
return $captures[2];
}
else
{
return;
}
}
function isValid() {
return $this->isValid;
}