Selaa lähdekoodia

安全问题修复

tags/6.1.0^2
tianya 3 vuotta sitten
vanhempi
commit
70de8c658a
2 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. +4
    -0
      src/admin/templets_one_add.php
  2. +4
    -0
      src/admin/templets_one_edit.php

+ 4
- 0
src/admin/templets_one_add.php Näytä tiedosto

@@ -16,6 +16,10 @@ if ($dopost == "save") {
$uptime = time(); $uptime = time();
$body = str_replace('"', '\\"', $body); $body = str_replace('"', '\\"', $body);
$filename = preg_replace("#^\/#", "", $nfilename); $filename = preg_replace("#^\/#", "", $nfilename);
if (!preg_match('#\.htm$#i', trim($template))) {
ShowMsg("您指定的文件名被系统禁止", "javascript:;");
exit();
}
if ($likeid == '') { if ($likeid == '') {
$likeid = $likeidsel; $likeid = $likeidsel;
} }


+ 4
- 0
src/admin/templets_one_edit.php Näytä tiedosto

@@ -17,6 +17,10 @@ if ($dopost == "saveedit") {
$uptime = time(); $uptime = time();
$body = str_replace('"', '\\"', $body); $body = str_replace('"', '\\"', $body);
$filename = preg_replace("#^\/#", "", $nfilename); $filename = preg_replace("#^\/#", "", $nfilename);
if (!preg_match('#\.htm$#i', trim($template))) {
ShowMsg("您指定的文件名被系统禁止", "javascript:;");
exit();
}
//如果修改了文件名,删除旧文件 //如果修改了文件名,删除旧文件
if ($oldfilename != $filename) { if ($oldfilename != $filename) {
$oldfilename = $cfg_basedir.$cfg_cmspath."/".$oldfilename; $oldfilename = $cfg_basedir.$cfg_cmspath."/".$oldfilename;


Loading…
Peruuta
Tallenna