몇일간 모듈 공부를 했는데, 시간이 안 되어서..
일단 이번에는 하던데로, 외부페이지로 개발해야겠습니다.
다음 그림과 같이 간단한 폼을 만들었습니다.
이 폼의 소스(외부페이지)는 다음과 같습니다.
<?php
$strVal1 = htmlentities(Context::get('txtVal1'), ENT_QUOTES, 'UTF-8');
$strVal2 = htmlentities(Context::get('txtVal2'), ENT_QUOTES, 'UTF-8');
$strVal3 = htmlentities(Context::get('txtVal3'), ENT_QUOTES, 'UTF-8');
$strVal4 = htmlentities(Context::get('txtVal4'), ENT_QUOTES, 'UTF-8');
?>
<div>
<form name="frm1" action="<?php echo htmlspecialchars("/mypage");?>" method="post">
<fieldset>
<legend>그룹1</legend>
<label for="txtVal1">값1</label><input id="txtVal1" name="txtVal1" type="text" title="값1" value="<?=$strVal1?>">
<label for="txtVal2">값2</label><input id="txtVal2" name="txtVal2" type="text" title="값2" value="<?=$strVal2?>">
</fieldset>
<fieldset>
<legend>그룹2</legend>
<label for="txtVal3">값3</label><input name="txtVal3" type="text" title="값3" value="<?=$strVal3?>">
<label for="txtVal4">값4</label><input name="txtVal4" type="text" title="값4" value="<?=$strVal4?>">
<input type="submit" value="확인">
</fieldset>
</form>
</div>
값을 입력하고 '확인' 버튼을 클릭하면 다음과 같은 오류메시지가 표시됩니다.
page.view.php 파일의 176행 근처는 다음과 같은 내용이 있습니다.
// Kick out anyone who tries to exploit RVE-2022-2.
foreach (Context::getRequestVars() as $key => $val)
{
if (preg_match('/[\{\}\(\)<>\$\'"]/', $key) || preg_match('/[\{\}\(\)<>\$\'"]/', $val))
{
throw new Rhymix\Framework\Exceptions\SecurityViolation();
}
}
입력란에 몇 몇 특수문자가 들어가면 오류가 발생되도록 처리한 것 같은데..
이 문제는 어떻게 해결하면 되겠습니까?
(입력값을 뭔가 라이믹스 함수를 이용해서 둘러싸주면 될 것 같은데 말이죠..)
$strVal1 = htmlentities(Context::get('txtVal1'), ENT_QUOTES, 'UTF-8');
$strVal1 = addslashes($strVal1);