비타민5

게시판에 첨부화일로 플래시를 넣으면..

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 :

보통 게시판에 첨부화일로 이미지를 넣으면
내용보기에 바로 이미지가 삽입되어 나옵니다만

첨부화일로 플래시를 넣으면
플래시 첨부화일을 한번 더 클릭해야 내용을 볼수 있게되네요..

플래시도 바로 본문내용에 나와서 클릭없이 바로 볼수 있는 방법이 있을까요?
|

댓글 4개

그누보드에서 플래시 첨부파일은 flash xss 공격으로 인하여 코드를 차단한것으로 아는데용...
정 보고 싶으시면 common.lib.php 파일에
view_file_link 함수를 수정해보세요~!
네..감사합니다...
어디부분을 어떻게 수정해야 할지..잘 모르겠어요

좀더 상세한 설명부탁은 어렵울까요?
그누보드 버전이 얼마인지 잘 모르겠는데요.
흠.. 제가 테스트로 설치된 버전에서 수정해야할 부분 알려드릴께요~

"110106 : FLASH XSS 공격으로 인하여 코드 자체를 막음" 부분부터
주석처리되어 있는데
주석을 제거해주세요~!

[code]
// 파일을 보이게 하는 링크 (이미지, 플래쉬, 동영상)
function view_file_link($file, $width, $height, $content="")
{
global $config, $board;
global $g4;
static $ids;

if (!$file) return;

$ids++;

// 파일의 폭이 게시판설정의 이미지폭 보다 크다면 게시판설정 폭으로 맞추고 비율에 따라 높이를 계산
if ($width > $board[bo_image_width] && $board[bo_image_width])
{
$rate = $board[bo_image_width] / $width;
$width = $board[bo_image_width];
$height = (int)($height * $rate);
}

// 폭이 있는 경우 폭과 높이의 속성을 주고, 없으면 자동 계산되도록 코드를 만들지 않는다.
if ($width)
$attr = " width='$width' height='$height' ";
else
$attr = "";

if (preg_match("/\.($config[cf_image_extension])$/i", $file))
// 이미지에 속성을 주지 않는 이유는 이미지 클릭시 원본 이미지를 보여주기 위한것임
// 게시판설정 이미지보다 크다면 스킨의 자바스크립트에서 이미지를 줄여준다
return "<img src='$g4[path]/data/file/$board[bo_table]/".urlencode($file)."' name='target_resize_image[]' onclick='image_window(this);' style='cursor:pointer;' title='$content'>";

// 110106 : FLASH XSS 공격으로 인하여 코드 자체를 막음
else if (preg_match("/\.($config[cf_flash_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(flash_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height', 'transparent'));</script>";

//=============================================================================================
// 동영상 파일에 악성코드를 심는 경우를 방지하기 위해 경로를 노출하지 않음
//---------------------------------------------------------------------------------------------
/*
else if (preg_match("/\.($config[cf_movie_extension])$/i", $file))
//return "<embed src='$g4[path]/data/file/$board[bo_table]/$file' $attr></embed>";
return "<script>doc_write(obj_movie('$g4[path]/data/file/$board[bo_table]/$file', '_g4_{$ids}', '$width', '$height'));</script>";
*/
//=============================================================================================
}
[/code]
너무 감사합니다^^

댓글 작성

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

로그인하기
🐛 버그신고