Allow setting the value of <input type="file"> to an empty string even in

untrusted script.  Bug 266744, r=sicking, sr=jst


git-svn-id: svn://10.0.0.236/trunk@164672 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2004-10-30 18:11:25 +00:00
parent 76880a8c4e
commit 39405c94cd

View File

@@ -639,8 +639,9 @@ nsHTMLInputElement::GetValue(nsAString& aValue)
NS_IMETHODIMP
nsHTMLInputElement::SetValue(const nsAString& aValue)
{
//check secuity
if (mType == NS_FORM_INPUT_FILE) {
// check security. Note that setting the value to the empty string is always
// OK and gives pages a way to clear a file input if necessary.
if (mType == NS_FORM_INPUT_FILE && !aValue.IsEmpty()) {
nsIScriptSecurityManager *securityManager =
nsContentUtils::GetSecurityManager();