Skip to content

Commit

Permalink
관리페이지에서 환경설정을 저장할 때 변조된 데이터가 사용될 수 있는 문제 수정 #296
Browse files Browse the repository at this point in the history
  • Loading branch information
thisgun committed Dec 18, 2023
1 parent 1fc3a34 commit fae53d3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions adm/config_form.php
Expand Up @@ -8,7 +8,9 @@
alert('최고관리자만 접근 가능합니다.');
}

$copy_config = get_config(true);
// https://github.com/gnuboard/gnuboard5/issues/296 이슈처리
$sql = " select * from {$g5['config_table']} limit 1";
$config = sql_fetch($sql);

if (!isset($config['cf_add_script'])) {
sql_query(
Expand Down Expand Up @@ -699,14 +701,14 @@
<th scope="row"><label for="cf_analytics">방문자분석 스크립트</label></th>
<td colspan="3">
<?php echo help('방문자분석 스크립트 코드를 입력합니다. 예) 구글 애널리틱스<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.'); ?>
<textarea name="cf_analytics" id="cf_analytics"><?php echo get_text($copy_config['cf_analytics']); ?></textarea>
<textarea name="cf_analytics" id="cf_analytics"><?php echo get_text($config['cf_analytics']); ?></textarea>
</td>
</tr>
<tr>
<th scope="row"><label for="cf_add_meta">추가 메타태그</label></th>
<td colspan="3">
<?php echo help('추가로 사용하실 meta 태그를 입력합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.'); ?>
<textarea name="cf_add_meta" id="cf_add_meta"><?php echo get_text($copy_config['cf_add_meta']); ?></textarea>
<textarea name="cf_add_meta" id="cf_add_meta"><?php echo get_text($config['cf_add_meta']); ?></textarea>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1392,7 +1394,7 @@
<th scope="row"><label for="cf_add_script">추가 script, css</label></th>
<td>
<?php echo help('HTML의 &lt;/HEAD&gt; 태그위로 추가될 JavaScript와 css 코드를 설정합니다.<br>관리자 페이지에서는 이 코드를 사용하지 않습니다.') ?>
<textarea name="cf_add_script" id="cf_add_script"><?php echo get_text($copy_config['cf_add_script']); ?></textarea>
<textarea name="cf_add_script" id="cf_add_script"><?php echo get_text($config['cf_add_script']); ?></textarea>
</td>
</tr>
</tbody>
Expand Down

0 comments on commit fae53d3

Please sign in to comment.