diff --git a/modules/krzip/krzip.model.php b/modules/krzip/krzip.model.php index 743d456ec..400b41061 100644 --- a/modules/krzip/krzip.model.php +++ b/modules/krzip/krzip.model.php @@ -61,21 +61,21 @@ class krzipModel extends krzip } /* 지번 주소 */ - if(preg_match('/\(.+\s.+[읍면동리(마을)(0-9+가)]\s[0-9-]+\)/', $output[1], $matches)) + if(preg_match('/\(.+\s\S+[읍면동리(마을)(0-9+가)]\s[0-9-]+\)/us', $output[1], $matches)) { $output[1] = trim(str_replace($matches[0], '', $output[1])); $output[2] = $matches[0]; } /* 부가 정보 */ - if(preg_match('/\(.+[읍면동리(마을)(0-9+가)](?:,.*)?\)/u', $output[1], $matches)) + if(preg_match('/\(\S+[읍면동리(마을)(0-9+가)](?:,.*)?\)/us', $output[1], $matches)) { $output[1] = trim(str_replace($matches[0], '', $output[1])); $output[4] = $matches[0]; } /* 상세 주소 */ - if(preg_match('/^(.+ [가-힝]+[0-9]*[동리로길]\s*[0-9-]+(?:번지?)?),?\s+(.+)$/u', $output[1], $matches)) + if(preg_match('/^(.+ [가-힝A-Za-z0-9.·-]+(?:[동리로]|번?안?길)\s*[0-9-]+(?:번지?)?),?\s+(.+)$/us', $output[1], $matches)) { $output[1] = trim($matches[1]); $output[3] = trim($matches[2]); diff --git a/modules/krzip/tpl/js/daumapi.js b/modules/krzip/tpl/js/daumapi.js index 1543494fa..49db03274 100644 --- a/modules/krzip/tpl/js/daumapi.js +++ b/modules/krzip/tpl/js/daumapi.js @@ -65,16 +65,20 @@ /* 예상 주소 저장 */ ui.guide.hide().html(""); if(response.autoRoadAddress) { - var expRoadAddr = (response.autoRoadAddress + extraRoadAddr); - ui.guide - .html("(" + xe.lang.msg_krzip_road_address_expectation.replace("%s", expRoadAddr) + ")") - .show(); + var expRoadAddr = response.autoRoadAddress; + if (expRoadAddr && !roadAddr) { + ui.roadAddress.val(expRoadAddr).trigger("change"); + } else { + ui.guide.html("(" + xe.lang.msg_krzip_road_address_expectation.replace("%s", expRoadAddr) + ")").show(); + } } else if(response.autoJibunAddress) { var expJibunAddr = response.autoJibunAddress; - ui.guide - .html("(" + xe.lang.msg_krzip_jibun_address_expectation.replace("%s", expJibunAddr) + ")") - .show(); + if (expJibunAddr && !jibunAddr) { + ui.jibunAddress.val("(" + expJibunAddr + ")").trigger("change"); + } else { + ui.guide.html("(" + xe.lang.msg_krzip_jibun_address_expectation.replace("%s", expJibunAddr) + ")").show(); + } } /* 상세 주소로 커서 이동 */