假设:
def unsafeF(x: String): String =
s"select * from TABLE WHERE x = $x"
是否可以通过unsafeF
中x
的函数调用来清理x
的输入$x
?
答案 0 :(得分:1)
只要你使用正确的Anorm字符串插值而不是标准的插值,就没有必要对它进行消毒。
SQL"select * from TABLE WHERE x = $x"
您可以在Anorm documentation中看到Anorm插值。