strstr()은 일치하는 부분 문자열 전체를 반환하므로 존재 여부만 체크할 때는 메모리 할당이 낭비됨. strpos()는 위치(int) 또는 false만 반환하여 메모리 할당 없이 더 빠르게 동일 동작 수행. 적용 파일 (19개, 약 25곳): - lib/common.lib.php: wr_option html1/html2/secret 검사 3곳 - lib/shop.lib.php: de_taxsave_types 검사 2곳 - lib/latest.lib.php: wr_option secret 검사 1곳 - lib/thumbnail.lib.php: wr_option secret 검사 1곳 - lib/URI/uri.class.php: URI 확장자 검사 1곳 - bbs/view.php: subject/wr_option/content 검사 4곳 - bbs/view_comment.php: wr_option secret 검사 1곳 - bbs/search.php: wr_option/sfl 검사 3곳 - bbs/rss.php: wr_option html 검사 1곳 - bbs/write_update.php: html1/html2 검사 2곳 - bbs/move_update.php: wr_option html 검사 1곳 - adm/admin.lib.php: auth 권한 검사 1곳 - adm/admin.head.php: 메뉴 권한 검사 1곳 - adm/session_file_delete.php: sess_ prefix 검사 1곳 - adm/point_list.php, adm/auth_list.php: sfl mb_id 검사 2곳 - adm/sms_admin/_common.php: install.php 검사 1곳 - adm/shop_admin/configform.php: de_taxsave_types 검사 3곳 - head.sub.php: admin dir 검사 1곳 규칙: strstr($a, $b) → strpos($a, $b) !== false !strstr($a, $b) → strpos($a, $b) === false 제외: - theme/, skin/, plugin/ (사용자 커스터마이징/서드파티) - strstr() 반환값을 실제로 사용하는 케이스 (예: lib/common.lib.php:4135 if( \$freg = strstr(\$ori_params, '#') ), extend/gif2mp4.extend.php)
32 lines
1.2 KiB
PHP
32 lines
1.2 KiB
PHP
<?php
|
|
define('G5_IS_ADMIN', true);
|
|
include_once ('../../common.php');
|
|
include_once(G5_ADMIN_PATH.'/admin.lib.php');
|
|
include_once(G5_SMS5_PATH.'/sms5.lib.php');
|
|
|
|
if (strpos($_SERVER['SCRIPT_NAME'], 'install.php') === false) {
|
|
// SMS5 테이블 G5_TABLE_PREFIX 적용
|
|
if($g5['sms5_prefix'] != 'sms5_' && sql_num_rows(sql_query("show tables like 'sms5_config'")))
|
|
{
|
|
echo '<script>
|
|
alert("기존 SMS5 테이블을 sms5 prefix 기준으로 변경합니다.\n(DB 업그레이드에서 자동 적용됩니다.)");
|
|
location.href = "'.G5_ADMIN_URL.'/dbupgrade.php";
|
|
</script>';
|
|
exit;
|
|
}
|
|
|
|
if(!sql_num_rows(sql_query(" show tables like '{$g5['sms5_config_table']}' ")))
|
|
goto_url('install.php');
|
|
|
|
// SMS 설정값 배열변수
|
|
//$sms5 = sql_fetch("select * from ".$g5['sms5_config_table'] );
|
|
}
|
|
|
|
$sv = isset($_REQUEST['sv']) ? get_search_string($_REQUEST['sv']) : '';
|
|
$st = (isset($_REQUEST['st']) && $st) ? substr(get_search_string($_REQUEST['st']), 0, 12) : '';
|
|
|
|
if( isset($token) ){
|
|
$token = @htmlspecialchars(strip_tags($token), ENT_QUOTES);
|
|
}
|
|
|
|
add_stylesheet('<link rel="stylesheet" href="'.G5_SMS5_ADMIN_URL.'/css/sms5.css">', 0); |