特黄性暴力强在线播放,免费成人在线电影,成人精品福利视频,国产视频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);
}
?>

贵定县| 安化县| 马山县| 五峰| 东至县| 贵定县| 巴里| 吉水县| 乐都县| 北安市| 嘉鱼县| 桂阳县| 上饶市| 麻城市| 南安市| 襄垣县| 互助| 敦煌市| 大英县| 温州市| 通渭县| 海伦市| 台山市| 钟山县| 梁平县| 比如县| 达日县| 阿拉善右旗| 漠河县| 林甸县| 油尖旺区| 乐至县| 九江县| 台中县| 依兰县| 驻马店市| 团风县| 杭州市| 峨边| 宿松县| 衢州市|