深キ眠リニ現ヲミル

放浪の凡人、中庸の雑記です。
SSなど綴る事アリ。

KB97445によるスクリプト不正 個人メモ

2009年10月22日 | 日記

MSの対応状況
ということで、誤情報を修正する暇もなく、コード修正・単体試験・単体試験検証・業務無影響試験・無影響試験検証と立て続けに対応していました。

で、前回の記事ではJavaScriptで記述しましたが、JavaScriptだとうまくいくらしい。で、うちの場合はVBSメインのため、JacaScriptを組むことなく下記のように修正しました。
概要としては、子画面で配列を文字列にして返却して、親画面で配列に戻すだけのこと。
だー、疲れた。つーかHtmlタグをエスケープするのにも疲れた。インデントはもはや面倒だ。誰か残業代をw



・親画面
修正前
<script type="VBScript">
<!--
Sub Window_Onload()
Dim result
result =
showModalDialog("XX.do?input1=XX&input2=YY", window, "status:false;dialogWidth:200px;dialogHeight:250px")
if IsArray(result) then
document.oForm.hidhoge1.value = result(0)
document.oForm.hidhoge2.value = result(1)
End if
End Sub
-->
</script>

修正後
<script type="VBScript">
<!--
Sub Window_Onload()
Dim result
result =
showModalDialog("XX.do?input1=XX&input2=YY", window, "status:false;dialogWidth:200px;dialogHeight:250px")

if IsEmpty(result) then
result = Split(result, "|")

document.oForm.hidhoge1.value = result(0)
document.oForm.hidhoge2.value = result(1)
End if
End Sub
-->
</script>


・子画面
修正前
<script type="VBScript">
<!--
Sub btnOK_Onclick()
window.returnValue = Array("ok", document.oForm.txtBox1.value)
window.close
End Sub

Sub btnCancel_Onclick()
window.returnValue = Array("Cancel", document.oForm.txtBox1.value)
window.close
End Sub
-->
</script>

修正後
<script type="VBScript">
<!--
Sub btnOK_Onclick()

ret = Array("ok", document.oForm.txtBox1.value)
window.returnValue = Join(ret, "|")

window.close
End Sub

Sub btnCancel_Onclick()

ret = Array("Cancel", document.oForm.txtBox1.value)
window.returnValue = Join(ret, "|")

window.close
End Sub
-->
</script>

最新の画像もっと見る