mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 0779a3cf6075 (bug 856265)
CLOSED TREE
This commit is contained in:
parent
1172e26981
commit
52bfba1848
@ -4671,10 +4671,18 @@ HTMLInputElement::GetValueAsDate(const nsAString& aValue,
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t endOfYearOffset = aValue.Length() - 6;
|
||||
uint32_t endOfYearOffset = 0;
|
||||
for (; NS_IsAsciiDigit(aValue[endOfYearOffset]); ++endOfYearOffset);
|
||||
|
||||
if (aValue[endOfYearOffset] != '-' ||
|
||||
aValue[endOfYearOffset + 3] != '-') {
|
||||
// The year must be at least 4 digits long.
|
||||
if (aValue[endOfYearOffset] != '-' || endOfYearOffset < 4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Now, we know where is the next '-' and what should be the size of the
|
||||
// string.
|
||||
if (aValue[endOfYearOffset + 3] != '-' ||
|
||||
aValue.Length() != 10 + (endOfYearOffset - 4)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user