mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 09:32:15 +09:00
Fix escaping and userlang encoding of site keywords and description
This commit is contained in:
parent
faf4b1ea54
commit
f84715db5b
3 changed files with 7 additions and 6 deletions
|
|
@ -2716,7 +2716,7 @@ class Context
|
||||||
foreach(self::$_instance->meta_tags as $key => $val)
|
foreach(self::$_instance->meta_tags as $key => $val)
|
||||||
{
|
{
|
||||||
list($name, $is_http_equiv) = explode("\t", $key);
|
list($name, $is_http_equiv) = explode("\t", $key);
|
||||||
$ret[] = array('name' => $name, 'is_http_equiv' => $is_http_equiv, 'content' => $val);
|
$ret[] = array('name' => $name, 'is_http_equiv' => $is_http_equiv, 'content' => escape($val, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
|
|
@ -2732,6 +2732,7 @@ class Context
|
||||||
*/
|
*/
|
||||||
public static function addMetaTag($name, $content, $is_http_equiv = FALSE)
|
public static function addMetaTag($name, $content, $is_http_equiv = FALSE)
|
||||||
{
|
{
|
||||||
|
getController('module')->replaceDefinedLangCode($content);
|
||||||
self::$_instance->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content;
|
self::$_instance->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -299,20 +299,20 @@ class ModuleHandler extends Handler
|
||||||
$module_config = $oModuleModel->getModuleConfig('module');
|
$module_config = $oModuleModel->getModuleConfig('module');
|
||||||
if ($module_info->meta_keywords)
|
if ($module_info->meta_keywords)
|
||||||
{
|
{
|
||||||
Context::addMetaTag('keywords', escape($module_info->meta_keywords));
|
Context::addMetaTag('keywords', $module_info->meta_keywords);
|
||||||
}
|
}
|
||||||
elseif($module_config->meta_keywords)
|
elseif($module_config->meta_keywords)
|
||||||
{
|
{
|
||||||
Context::addMetaTag('keywords', escape($module_config->meta_keywords));
|
Context::addMetaTag('keywords', $module_config->meta_keywords);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($module_info->meta_description)
|
if ($module_info->meta_description)
|
||||||
{
|
{
|
||||||
Context::addMetaTag('description', escape($module_info->meta_description));
|
Context::addMetaTag('description', $module_info->meta_description);
|
||||||
}
|
}
|
||||||
elseif($module_config->meta_description)
|
elseif($module_config->meta_description)
|
||||||
{
|
{
|
||||||
Context::addMetaTag('description', escape($module_config->meta_description));
|
Context::addMetaTag('description', $module_config->meta_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
$viewType = (Mobile::isFromMobilePhone()) ? 'M' : 'P';
|
$viewType = (Mobile::isFromMobilePhone()) ? 'M' : 'P';
|
||||||
|
|
|
||||||
|
|
@ -1073,7 +1073,7 @@ class moduleController extends module
|
||||||
{
|
{
|
||||||
if($isReplaceLangCode)
|
if($isReplaceLangCode)
|
||||||
{
|
{
|
||||||
$output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output);
|
$output = preg_replace_callback('!\$user_lang-(?:>|&(?:amp;)?gt;)([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue