관리자페이지 상품명 출력부분 특수문자 출력부분 질문있습니다.

관리자페이지 상품명 출력부분 특수문자 출력부분 질문있습니다.

QA

관리자페이지 상품명 출력부분 특수문자 출력부분 질문있습니다.

답변 2

본문

3660691556_1599571612.402.png

위의 사진과 같이 관리자 페이지에서 IT'S SKIN처럼 제품명에 특수문자 '가 들어가면 출력 시에

크롬 개발자툴에서처럼 


value="伊思[IT" s="" skin]프레스티지="" 로씨옹="" 진생데스까르고="" 140ml'="" 

나타납니다. 상품명을 DB에서 불러올 때 어디서 특수문자가 붙어서오는지 모르겠습니다.

3660691556_1599572312.728.png

 

아래 코드는 해당 출력부분 소스입니다.

adm/eyoom_admin/theme/basic/skin/shop/itemlist.html.php


제품명_유형: "<label class='input'><p>한국어<input type='text' name='it_name[<?php echo $i; ?>]' id='it_name_<?php echo $i; ?>' value='<?php echo get_text($list[$i]['it_name']); ?>' required></p><p>중국어<input type='text' name='it_name_cn[<?php echo $i; ?>]' id='it_name_cn_<?php echo $i; ?>' value='<?php echo get_text($list[$i]['it_name_cn']); ?>' required></p><p>영어<input type='text' name='it_name_us[<?php echo $i; ?>]' id='it_name_us<?php echo $i; ?>' value='<?php echo get_text($list[$i]['it_name_us']); ?>' required></p></label><div class='item-type-divider'></div><div class='item-type-box'><div class='inline-group item-type-group'><label class='checkbox' for='it_type1_<?php echo $i; ?>'><input type='checkbox' name='it_type1[<?php echo $i; ?>]' id='it_type1_<?php echo $i; ?>' value='1' <?php echo $list[$i]['it_type1'] ? 'checked': ''; ?>><i></i> <span class='label bg-dark lighter color-white'>히트</span></label><label class='checkbox' for='it_type2_<?php echo $i; ?>'><input type='checkbox' name='it_type2[<?php echo $i; ?>]' id='it_type2_<?php echo $i; ?>' value='1' <?php echo $list[$i]['it_type2'] ? 'checked': ''; ?>><i></i> <span class='label bg-yellow lighter color-white'>추천</span></label><label class='checkbox' for='it_type3_<?php echo $i; ?>'><input type='checkbox' name='it_type3[<?php echo $i; ?>]' id='it_type3_<?php echo $i; ?>' value='1' <?php echo $list[$i]['it_type3'] ? 'checked': ''; ?>><i></i> <span class='label bg-red lighter color-white'>신상</span></label><label class='checkbox' for='it_type4_<?php echo $i; ?>'><input type='checkbox' name='it_type4[<?php echo $i; ?>]' id='it_type4_<?php echo $i; ?>' value='1' <?php echo $list[$i]['it_type4'] ? 'checked': ''; ?>><i></i> <span class='label bg-green lighter color-white'>인기</span></label><label class='checkbox' for='it_type5_<?php echo $i; ?>'><input type='checkbox' name='it_type5[<?php echo $i; ?>]' id='it_type5_<?php echo $i; ?>' value='1' <?php echo $list[$i]['it_type5'] ? 'checked': ''; ?>><i></i> <span class='label bg-purple lighter color-white'>할인</span></label></div></div>",

 

아래 코드는 get_text 함수입니다.

lib/common.lib.php


// TEXT 형식으로 변환
function get_text($str, $html=0, $restore=false)
{
    $source[] = "<";
    $target[] = "<";
    $source[] = ">";
    $target[] = ">";
    $source[] = "\"";
    $target[] = """;
    $source[] = "\'";
    $target[] = "'";
    if($restore){
        $str = str_replace($target, $source, $str);
    }
      
    // 3.31
    // TEXT 출력일 경우 &   등의 코드를 정상으로 출력해 주기 위함
    if ($html == 0) {
        $str = html_symbol($str);
    }
    if ($html) {
        $source[] = "\n";
        $target[] = "<br/>";
    }
    
    return str_replace($source, $target, $str);
}

이 질문에 댓글 쓰기 :

답변 2

특수문자 들어가서 출력을 한다구요?? 

value="伊思[IT"
DB에 있는 값 IT'S가 되야하는데 IT뒤에 "가 붙어서 伊思[IT까지만 출력합니다.
어디서 '가 "으로 바뀌어서 찍히는지 모르겠어요

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 16,792
© SIRSOFT
현재 페이지 제일 처음으로