diff --git a/app/Views/bag/layout/embed.php b/app/Views/bag/layout/embed.php index 43c777d..4da288f 100644 --- a/app/Views/bag/layout/embed.php +++ b/app/Views/bag/layout/embed.php @@ -196,8 +196,19 @@ tailwind.config = { document.addEventListener('submit', function (e) { var f = e.target; if (!f || f.tagName !== 'FORM') return; - var ne = withEmbed(f.getAttribute('action') || location.href); - if (ne) f.setAttribute('action', ne); + var method = (f.getAttribute('method') || 'get').toLowerCase(); + if (method === 'get') { + // GET 폼은 제출 시 action의 쿼리스트링이 폼 필드로 대체되므로, + // action 수정 대신 hidden input 으로 embed=1 을 유지한다(중첩 셸 방지). + if (!f.querySelector('input[name="embed"]')) { + var h = document.createElement('input'); + h.type = 'hidden'; h.name = 'embed'; h.value = '1'; + f.appendChild(h); + } + } else { + var ne = withEmbed(f.getAttribute('action') || location.href); + if (ne) f.setAttribute('action', ne); + } }, true); // 표 '번호' 컬럼 역순 채번 (사이트 레이아웃과 동일) var run = function () {