| Index: net/ftp/ftp_util.cc
|
| diff --git a/net/ftp/ftp_util.cc b/net/ftp/ftp_util.cc
|
| index abbeeda38f183a43c6bf15c6652aaa715f3e180c..441c666217b3123c9a798599e4756bd147187f6b 100644
|
| --- a/net/ftp/ftp_util.cc
|
| +++ b/net/ftp/ftp_util.cc
|
| @@ -139,7 +139,12 @@ bool FtpUtil::AbbreviatedMonthToNumber(const string16& text, int* number) {
|
| // An alternative solution (to parse |text| in given locale) is more
|
| // lenient, and may accept more than we want even with setLenient(false).
|
| for (int32_t month = 0; month < months_count; month++) {
|
| - if (months[month].caseCompare(unicode_text, 0) == 0) {
|
| + // Compare (case-insensitive), but just first three characters. Sometimes
|
| + // ICU returns longer strings (for example for Russian locale), and in FTP
|
| + // listings they are abbreviated to just three characters.
|
| + // Note: ICU may also return strings shorter than three characters,
|
| + // and those also should be accepted.
|
| + if (months[month].caseCompare(0, 3, unicode_text, 0) == 0) {
|
| *number = month + 1;
|
| return true;
|
| }
|
| @@ -161,6 +166,8 @@ bool FtpUtil::LsDateListingToTime(const string16& month, const string16& day,
|
|
|
| if (!base::StringToInt(day, &time_exploded.day_of_month))
|
| return false;
|
| + if (time_exploded.day_of_month > 31)
|
| + return false;
|
|
|
| if (!base::StringToInt(rest, &time_exploded.year)) {
|
| // Maybe it's time. Does it look like time (HH:MM)?
|
|
|