Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1509)

Unified Diff: Source/core/platform/network/FormDataBuilder.cpp

Issue 25417007: Handle crash when submitting an injected form on an "image page". (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test cleanup and rebase code. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/platform/network/FormDataBuilder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/network/FormDataBuilder.cpp
diff --git a/Source/core/platform/network/FormDataBuilder.cpp b/Source/core/platform/network/FormDataBuilder.cpp
index 117a5beb7a275bd061696a4ba1eadb4453a7dc5c..5321f3b4d7b15f3894d5f8d5ef5ceac180c7ee02 100644
--- a/Source/core/platform/network/FormDataBuilder.cpp
+++ b/Source/core/platform/network/FormDataBuilder.cpp
@@ -74,7 +74,7 @@ static void appendQuotedString(Vector<char>& buffer, const CString& string)
}
}
-WTF::TextEncoding FormDataBuilder::encodingFromAcceptCharset(const String& acceptCharset, const String& inputEncoding)
+WTF::TextEncoding FormDataBuilder::encodingFromAcceptCharset(const String& acceptCharset, const String& inputEncoding, const String& defaultCharset)
{
String normalizedAcceptCharset = acceptCharset;
normalizedAcceptCharset.replace(',', ' ');
@@ -90,6 +90,13 @@ WTF::TextEncoding FormDataBuilder::encodingFromAcceptCharset(const String& accep
return encoding;
}
+ if (inputEncoding.isEmpty()) {
+ if (defaultCharset.isEmpty())
+ return WTF::UTF8Encoding();
+
+ return defaultCharset;
+ }
+
return inputEncoding;
}
« no previous file with comments | « Source/core/platform/network/FormDataBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698