수정전 코드
// 회원 정보를 얻는다.
function get_member($mb_id, $fields = '*', $is_cache = false)
{
global $g5;
if (preg_match("/[^0-9a-z_]+/i", $mb_id))
return array();
static $cache = array();
$key = md5($fields);
if ($is_cache && isset($cache[$mb_id]) && isset($cache[$mb_id][$key])) {
return $cache[$mb_id][$key];
}
$sql = " select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') ";
$cache[$mb_id][$key] = run_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache);
return $cache[$mb_id][$key];
}
common.lib 에 있는 function get_member 부분 에서
if (preg_match("/[^0-9a-z_]+/i", $mb_id)) return array();
부분을 주석처리함으로써 @표시를 이용 할 수있다.
추가적으로 기존 그누보드 DB에 mb_id 에 varchar의 사이즈를 키워줘야 한다.
수정 이후 코드
// 회원 정보를 얻는다.
function get_member($mb_id, $fields = '*', $is_cache = false)
{
global $g5;
/*if (preg_match("/[^0-9a-z_]+/i", $mb_id))
return array();*/
static $cache = array();
$key = md5($fields);
if ($is_cache && isset($cache[$mb_id]) && isset($cache[$mb_id][$key])) {
return $cache[$mb_id][$key];
}
$sql = " select $fields from {$g5['member_table']} where mb_id = TRIM('$mb_id') ";
$cache[$mb_id][$key] = run_replace('get_member', sql_fetch($sql), $mb_id, $fields, $is_cache);
return $cache[$mb_id][$key];
}
'IT 정보' 카테고리의 다른 글
그누보드/영카트 관리자 회원 추가 (0) | 2024.06.10 |
---|---|
모든 체크 박스 선택/해제 기능 구현하기 (전체 선택, 개별 선택) (0) | 2024.06.05 |
php/그누보드/영카트 이동시 포스트로 데이터 갖고 넘기기 (0) | 2024.06.05 |
그누보드/영카트 관리자에서 로고 이미지 등록 하는법 (0) | 2024.06.05 |
디스코드 오류 해결하기 - 안 켜지거나 실행 안 되는 경우의 대처법 (0) | 2023.10.01 |