特黄性暴力强在线播放,免费成人在线电影,成人精品福利视频,国产视频www,88888888国产一区二区,久热九九,刘亦菲人久久精品二区三区

首頁(yè) 服務(wù) 產(chǎn)品 文檔 關(guān)于

TQCMS 驗證碼無(wú)法正常顯示問(wèn)題

因為do_seccode.php編輯不當,帶bom頭導致,找攻擊清除即可。

以下代碼保存為php到站點(diǎn)根目錄運行科將所有包含bom頭的文件清除bom頭


if (isset($_GET['dir'])) { //設置文件目錄
? ? $basedir = $_GET['dir'];
} else {
? ? $basedir = '.';
}

$auto = 1;
checkdir($basedir);

function checkdir($basedir)
{
? ? if ($dh = opendir($basedir)) {
? ? ? ? while (($file = readdir($dh)) !== false) {
? ? ? ? ? ? if ($file != '.' && $file != '..') {
? ? ? ? ? ? ? ? if (!is_dir($basedir . "/" . $file)) {
? ? ? ? ? ? ? ? ? ? echo "filename: $basedir/$file " . checkBOM("$basedir/$file") . "
";
? ? ? ? ? ? ? ? } else {
? ? ? ? ? ? ? ? ? ? $dirname = $basedir . "/" . $file;
? ? ? ? ? ? ? ? ? ? checkdir($dirname);
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? }
? ? ? ? closedir($dh);
? ? }
}
function checkBOM($filename)
{
? ? global $auto;
? ? $contents? ?= file_get_contents($filename);
? ? $charset[1] = substr($contents, 0, 1);
? ? $charset[2] = substr($contents, 1, 1);
? ? $charset[3] = substr($contents, 2, 1);
? ? if (ord($charset[1]) == 239 && ord($charset[2]) == 187 && ord($charset[3]) == 191) {
? ? ? ? if ($auto == 1) {
? ? ? ? ? ? $rest = substr($contents, 3);
? ? ? ? ? ? rewrite($filename, $rest);
? ? ? ? ? ? return ('BOM found, automatically removed.');
? ? ? ? } else {
? ? ? ? ? ? return ('BOM found.');
? ? ? ? }
? ? } else
? ? ? ? return ("BOM Not Found.");
}

function rewrite($filename, $data)
{
? ? $filenum = fopen($filename, "w");
? ? flock($filenum, LOCK_EX);
? ? fwrite($filenum, $data);
? ? fclose($filenum);
}
?>

丰宁| 浦北县| 潮州市| 榆中县| 布拖县| 浦东新区| 紫金县| 沛县| 襄樊市| 安化县| 磐安县| 临朐县| 淮南市| 宜春市| 鄢陵县| 长丰县| 克山县| 桃园市| 普兰店市| 墨玉县| 资阳市| 藁城市| 大悟县| 东兰县| 柯坪县| 平江县| 盐亭县| 濮阳市| 普宁市| 麟游县| 板桥市| 泾川县| 汝城县| 廊坊市| 酉阳| 祁东县| 盐山县| 北海市| 通海县| 汾阳市| 缙云县|