remove get_magic_quotes_gpc
This commit is contained in:
parent
1d086f7706
commit
ecf7751bcf
3 changed files with 57 additions and 34 deletions
|
|
@ -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']) {
|
||||
|
|
|
|||
|
|
@ -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']) {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
?><!doctype html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>오류! <?php echo G5_VERSION ?> 설치하기</title>
|
||||
<link rel="stylesheet" href="install/install.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="ins_bar">
|
||||
<span id="bar_img">AVOCADO EDITION</span>
|
||||
|
|
@ -403,7 +424,8 @@ if (file_exists($dbconfig_file)) {
|
|||
<p>GPL! OPEN SOURCE GNUBOARD</p>
|
||||
</div>
|
||||
</body>
|
||||
</html><?php
|
||||
|
||||
</html><?php
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
@ -417,34 +439,39 @@ if (strstr($url, 'adm')) {
|
|||
if (!defined('G5_IS_ADMIN')) {
|
||||
$cssconfig_file = G5_DATA_PATH . '/css/_design.config.css';
|
||||
if (!file_exists($cssconfig_file)) {
|
||||
?><!doctype html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>오류! <?php echo G5_VERSION ?> 설치하기</title>
|
||||
<link rel="stylesheet" href="<?= G5_URL ?>/install/install.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="ins_bar">
|
||||
<span id="bar_img">AVOCADO EDITION</span>
|
||||
<span id="bar_txt">Message</span>
|
||||
</div>
|
||||
<h1>아보카도 에디션 설정을 완료해주십시오.</h1>
|
||||
<br />
|
||||
<div class="ins_inner">
|
||||
<p>아보카도 에디션 라이트 설치가 완료 되었습니다.</p>
|
||||
<p>하지만, 아보카도 에디션의 디자인 설정이 완료되지 않았습니다.</p>
|
||||
<p>사이트 관리 화면에서 디자인 설정을 완료하여 주시길 바랍니다. (최소 1번 이상 저장 필요)</p>
|
||||
<div class="inner_btn">
|
||||
<a href="<?php echo G5_URL; ?>/adm/"><?php echo G5_VERSION ?> 관리자 바로가기</a>
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>오류! <?php echo G5_VERSION ?> 설치하기</title>
|
||||
<link rel="stylesheet" href="<?= G5_URL ?>/install/install.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="ins_bar">
|
||||
<span id="bar_img">AVOCADO EDITION</span>
|
||||
<span id="bar_txt">Message</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ins_ft">
|
||||
<strong>AVOCADO EDITION : AMBER</strong>
|
||||
<p>GPL! OPEN SOURCE GNUBOARD</p>
|
||||
</div>
|
||||
</body>
|
||||
</html><?php exit;
|
||||
<h1>아보카도 에디션 설정을 완료해주십시오.</h1>
|
||||
<br />
|
||||
<div class="ins_inner">
|
||||
<p>아보카도 에디션 라이트 설치가 완료 되었습니다.</p>
|
||||
<p>하지만, 아보카도 에디션의 디자인 설정이 완료되지 않았습니다.</p>
|
||||
<p>사이트 관리 화면에서 디자인 설정을 완료하여 주시길 바랍니다. (최소 1번 이상 저장 필요)</p>
|
||||
<div class="inner_btn">
|
||||
<a href="<?php echo G5_URL; ?>/adm/"><?php echo G5_VERSION ?> 관리자 바로가기</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ins_ft">
|
||||
<strong>AVOCADO EDITION : AMBER</strong>
|
||||
<p>GPL! OPEN SOURCE GNUBOARD</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<?php exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue