테스트 사이트 - 개발 중인 베타 버전입니다

CSRF 오류가 나게 하는 /extend 내 파일 좀 봐주세요.

CaoCao가나타났다CaoCao가나타
· 12년 전 · 1583 · 7
안녕하세요. 정말 해결이 안되네요

어떤 파일 때문인지는 알았습니다.

/extend 폴더 내에 다음과 같은 rank5.php 파일 때문인데요,

<?
//Rank Top5 추출
function Rank5($skin_dir="", $rows=10, $subject_len=16, $options="")
{
global $g4;
global $g_id;

$year = date("Y");
$month = date("m");
$day = date("d");

//$tmp = mktime(0, 0, 0, $month - 1 , $day, $year, 0);
$tmp = mktime(0, 0, 0, $month, $day, $year);
$lastmonth = date("Y-m",$tmp);


if ($skin_dir)
$skin_path = "$g4[path]/skin/top10/$skin_dir";
else
$skin_path = "$g4[path]/skin/top10/rank5";

$Writelist = array();
$Commentlist = array();
$Visitlist = array();

//글쓰기 랭킹
$sql_common = " from $g4[board_new_table] a, $g4[member_table] b "; //where mb_level < 10 ";
$sql_common = $sql_common . " where a.bn_datetime like '" . $lastmonth . "%' ";
$sql_common = $sql_common . " and a.mb_id <> ''";
$sql_common = $sql_common . " and a.wr_id = a.wr_parent ";
$sql_common = $sql_common . " and a.mb_id = b.mb_id ";
$sql_common = $sql_common . " and b.mb_level < 10 ";
$sql_order = " order by cnt desc ";


$sql = " SELECT b.mb_nick,count(*) cnt
$sql_common
group by b.mb_nick
$sql_order
limit 0,$rows";

$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{

$Writelist[$i][mb_nick] = conv_subject($row[mb_nick], $subject_len, "..");
$Writelist[$i][mb_cnt] = $row[cnt];
}

//코멘트 랭킹
$sql_common = " from $g4[board_new_table] a, $g4[member_table] b "; //where mb_level < 10 ";
$sql_common = $sql_common . " where a.bn_datetime like '" . $lastmonth . "%' ";
$sql_common = $sql_common . " and a.mb_id <> ''";
$sql_common = $sql_common . " and a.wr_id <> a.wr_parent ";
$sql_common = $sql_common . " and a.mb_id = b.mb_id ";
$sql_common = $sql_common . " and b.mb_level < 10 ";
$sql_order = " order by cnt desc ";

$sql = " SELECT b.mb_nick,count(*)cnt
$sql_common
group by b.mb_nick
$sql_order
limit 0, $rows";

$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{

$Commentlist[$i][mb_nick] = conv_subject($row[mb_nick], $subject_len, "..");
$Commentlist[$i][mb_cnt] = $row[cnt];
}

//방문자 랭킹
$sql_common = " from $g4[point_table] a, $g4[member_table] b "; //where mb_level < 10 ";
$sql_common = $sql_common . " where a.po_datetime like '" . $lastmonth . "%' ";
$sql_common = $sql_common . " and a.mb_id <> ''";
$sql_common = $sql_common . " and a.mb_id = b.mb_id ";
$sql_common = $sql_common . " and po_rel_table = '@login' ";
$sql_common = $sql_common . " and b.mb_level < 10 ";
$sql_order = " order by cnt desc ";

$sql = " SELECT b.mb_nick,count(*)cnt
$sql_common
group by b.mb_nick
$sql_order
limit 0, $rows";

$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{

$Visitlist[$i][mb_nick] = conv_subject($row[mb_nick], $subject_len, "..");
$Visitlist[$i][mb_cnt] = $row[cnt];
}

ob_start();
include "$skin_path/rank.skin.php";
$content = ob_get_contents();
ob_end_clean();

return $content;
}
?>


이 파일이 들어가면 csrf 가 엑박으로 나옵니다. 이 파일과 관련된 스킨이

사이트 내 꼭 필요한 거라서 파일을 뺄 수 없는 상황입니다ㅠㅠ

무엇이 잘못되었을까요?



검색해본 결과 charset 문제는 아니였습니다. 그리고 <? ?> 뒤에 공백도 없구요.

bbs/kcaptcha.php 관련 파일 <? ?> 뒤에 다 공백 없습니다.

아시는 분 없으신가요...

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 7개

?> <---끝 부분에 분명히 공백이 들어가있습니다
이 부분 탓이니 이 라인 지우고 직접 타이핑하세요
CaoCao가나타났다CaoCao가나타
12년 전
균이님 답변 감사합니다. 그런데, 라인 지우고 타이핑해도 똑같아요. 위에 올려진 것을 긁어보니 공백이 있네요. 그런데 제 원소스를 다시 긁어보니 없습니다. 우연하게 위 내용상 소스에 공백이 생긴 것 같아요.
위 코드를 extend 폴더에 넣어보았는데 말이죠
마지막 공백 없애니 전혀 문제 없습니다
첨부화일로 등록해보세요 다운 받아서 extend에 넣어볼테니까요
CaoCao가나타났다CaoCao가나타
12년 전
균이님 이리 신경 써주셔서 감사합니다. 첨부 파일 올렸어요...
이유는 모르겠군요
기존 화일 삭제하고 <? ?> 사이를 복사해서 화일을 다시 만들어보세요
그래도 안된다면 extend 폴더에서 lib폴더로 이동 후
이 화일을 사용하는 부분 상단에서
include_once "$g4[path]/lib/rank.php"; 이렇게 해서 사용하면 됩니다
이분최고!!!!!!!!!!
CaoCao가나타났다CaoCao가나타
12년 전
균이님 말씀하신 include_once "$g4[path]/lib/rank.php"; 로 해결됐습니다. 정말.......고맙습니다. (_ _)

게시글 목록

번호 제목
284508
284499
284492
284490
284484
284481
284478
284476
284474
284472
284470
284458
284457
284454
284453
284447
284446
284444
284441
284440