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

Unified Diff: Source/core/html/forms/TextFieldInputType.cpp

Issue 189843008: Value sanitization for input[type=text] should not truncate a value at control character (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bug196640
Patch Set: Updated as per review comments Created 6 years, 9 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 | « LayoutTests/fast/forms/paste-multiline-text-input.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/forms/TextFieldInputType.cpp
diff --git a/Source/core/html/forms/TextFieldInputType.cpp b/Source/core/html/forms/TextFieldInputType.cpp
index 22b6e1385719922354961482252a0759f871c986..1a73c970f2acce3ae339f7565f35be29cd22498f 100644
--- a/Source/core/html/forms/TextFieldInputType.cpp
+++ b/Source/core/html/forms/TextFieldInputType.cpp
@@ -399,15 +399,6 @@ static bool isASCIILineBreak(UChar c)
static String limitLength(const String& string, unsigned maxLength)
{
unsigned newLength = std::min(maxLength, string.length());
- // FIXME: We should not truncate the string at a control character. It's not
- // compatible with IE and Firefox.
- for (unsigned i = 0; i < newLength; ++i) {
- const UChar current = string[i];
- if (current < ' ' && current != '\t') {
- newLength = i;
- break;
- }
- }
if (newLength == string.length())
return string;
if (newLength > 0 && U16_IS_LEAD(string[newLength - 1]))
« no previous file with comments | « LayoutTests/fast/forms/paste-multiline-text-input.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698