在修改destoon模板的时候,会报模版内容包含不安全写法,请通过FTP修改模版,怎么处理呢,下面告诉你方法
找到admin目录下的template.inc.php,找到以下,大概在35行 。
function template_safe($content) {
$content =
stripslashes($content);
$content = strip_sql($content,
0);
if(preg_match_all("/script([^>]+)>/i", $content, $matches))
{
foreach($matches[1] as $m) {
$m =
strtolower($m);
if(strpos($m, 'language') !== false || strpos($m, 'php')
!== false)
msg('模板内容包含不安全写法,禁止在线修改或预览');
}
}
if(preg_match("/(\<\?|\{php|file\(|eval|copy|file_put|file_get|fopen|fwrite|fread)/i",
$content)) msg('模板内容包含不安全写法,禁止在线修改或预览');
return $content;
}
把红色部分注释掉:
function template_safe($content) {
$content = stripslashes($content);
$content = strip_sql($content, 0);
if(preg_match_all("/script([^>]+)>/i", $content, $matches)) {
foreach($matches[1] as $m) {
$m = strtolower($m);
if(strpos($m, 'language') !== false || strpos($m, 'php') !== false) msg('模板内容包含不安全写法,禁止在线修改或预览');
}
}
if(preg_match("/(\<\?|\{php|file\(|eval|copy|file_put|file_get|fopen|fwrite|fread)/i", $content)) msg('模板内容包含不安全写法,禁止在线修改或预览');
return $content;
}
注释掉对应的就可以了!