diff --git a/AvocadoEdition_Light/bbs/write_update.php b/AvocadoEdition_Light/bbs/write_update.php index b1f3da0..470fff5 100644 --- a/AvocadoEdition_Light/bbs/write_update.php +++ b/AvocadoEdition_Light/bbs/write_update.php @@ -596,9 +596,7 @@ if ($upload_count != 0) { // 나중에 테이블에 저장하는 이유는 $wr_id 값을 저장해야 하기 때문입니다. for ($i = 0; $i < count($upload); $i++) { - if (!get_magic_quotes_gpc()) { - $upload[$i]['source'] = addslashes($upload[$i]['source']); - } + $upload[$i]['source'] = handle_magic_quotes($upload[$i]['source']); $row = sql_fetch("SELECT count(*) as cnt FROM {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' "); if ($row['cnt']) { diff --git a/AvocadoEdition_Light/bbs/write_update_file.php b/AvocadoEdition_Light/bbs/write_update_file.php index 3cd3b81..e469842 100644 --- a/AvocadoEdition_Light/bbs/write_update_file.php +++ b/AvocadoEdition_Light/bbs/write_update_file.php @@ -582,9 +582,7 @@ for ($i = 0; $i < count($_FILES['bf_file']['name']); $i++) { // 나중에 테이블에 저장하는 이유는 $wr_id 값을 저장해야 하기 때문입니다. for ($i = 0; $i < count($upload); $i++) { - if (!get_magic_quotes_gpc()) { - $upload[$i]['source'] = addslashes($upload[$i]['source']); - } + $upload[$i]['source'] = handle_magic_quotes($upload[$i]['source']); $row = sql_fetch("SELECT count(*) as cnt FROM {$g5['board_file_table']} where bo_table = '{$bo_table}' and wr_id = '{$wr_id}' and bf_no = '{$i}' "); if ($row['cnt']) { diff --git a/AvocadoEdition_Light/common.php b/AvocadoEdition_Light/common.php index e310edc..422fe32 100644 --- a/AvocadoEdition_Light/common.php +++ b/AvocadoEdition_Light/common.php @@ -158,6 +158,25 @@ function array_map_deep($fn, $array) return $array; } +/** + * Magic Quotes와 호환되는 방식으로 문자열을 처리합니다. + * PHP 5.6부터 PHP 8.3까지 호환됩니다. + * + * @param string $value 처리할 문자열 + * @return string 처리된 문자열 + */ +function handle_magic_quotes($value) +{ + if (version_compare(PHP_VERSION, '7.4.0', '>=')) { + return addslashes($value); + } else { + if (!get_magic_quotes_gpc()) { + return addslashes($value); + } + } + return $value; +} + // SQL Injection 대응 문자열 필터링 function sql_escape_string($str) { @@ -377,11 +396,13 @@ if (file_exists($dbconfig_file)) { } else { ?> + 오류! <?php echo G5_VERSION ?> 설치하기 +
AVOCADO EDITION @@ -403,7 +424,8 @@ if (file_exists($dbconfig_file)) {

GPL! OPEN SOURCE GNUBOARD

- - - - - 오류! <?php echo G5_VERSION ?> 설치하기 - - - -
- AVOCADO EDITION - Message -
-

아보카도 에디션 설정을 완료해주십시오.

-
-
-

아보카도 에디션 라이트 설치가 완료 되었습니다.

-

하지만, 아보카도 에디션의 디자인 설정이 완료되지 않았습니다.

-

사이트 관리 화면에서 디자인 설정을 완료하여 주시길 바랍니다. (최소 1번 이상 저장 필요)

-
- 관리자 바로가기 + ?> + + + + + + 오류! <?php echo G5_VERSION ?> 설치하기 + + + + +
+ AVOCADO EDITION + Message
-
-
- AVOCADO EDITION : AMBER -

GPL! OPEN SOURCE GNUBOARD

-
- -아보카도 에디션 설정을 완료해주십시오. +
+
+

아보카도 에디션 라이트 설치가 완료 되었습니다.

+

하지만, 아보카도 에디션의 디자인 설정이 완료되지 않았습니다.

+

사이트 관리 화면에서 디자인 설정을 완료하여 주시길 바랍니다. (최소 1번 이상 저장 필요)

+ +
+
+ AVOCADO EDITION : AMBER +

GPL! OPEN SOURCE GNUBOARD

+
+ + + +