0
我在Rails
以下控制器:什麼是消毒destroy_all的最佳方式 - Rails的
class FooController < ApplicationController
def delete_foo(bar):
Foo.destroy_all("foo = '#{@bar}'")
是
Foo.destroy_all("foo = ?", @bar)
總是有效的?
您可以承受的'SQL'攻擊那裏。 – cybertextron
是的,我們應該考慮在SQL中使用外部字符串時的安全後果。 – pangpang