Changeset 220444 in webkit
- Timestamp:
- Aug 9, 2017 12:00:34 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r220443 r220444 1 2017-08-09 Zan Dobersek <zdobersek@igalia.com> 2 3 [Soup] Incorrect conversion in msToSoupDate() 4 https://bugs.webkit.org/show_bug.cgi?id=175320 5 6 Reviewed by Carlos Garcia Campos. 7 8 Original patch by VaL Doroshchuk. 9 10 * platform/network/soup/NetworkStorageSessionSoup.cpp: 11 (WebCore::msToSoupDate): monthFromDayInYear() returns a value in the [0,11] range, 12 while soup_date_new() expects a month value in the [1,12] range. The return value 13 must be thus incremented by one to match that expectation. 14 1 15 2017-08-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 16 -
trunk/Source/WebCore/platform/network/soup/NetworkStorageSessionSoup.cpp
r219290 r220444 295 295 int dayOfYear = dayInYear(ms, year); 296 296 bool leapYear = isLeapYear(year); 297 return soup_date_new(year, monthFromDayInYear(dayOfYear, leapYear), dayInMonthFromDayInYear(dayOfYear, leapYear), msToHours(ms), msToMinutes(ms), static_cast<int>(ms / 1000) % 60); 297 298 // monthFromDayInYear() returns a value in the [0,11] range, while soup_date_new() expects 299 // a value in the [1,12] range, meaning we have to manually adjust the month value. 300 return soup_date_new(year, monthFromDayInYear(dayOfYear, leapYear) + 1, dayInMonthFromDayInYear(dayOfYear, leapYear), msToHours(ms), msToMinutes(ms), static_cast<int>(ms / 1000) % 60); 298 301 } 299 302
Note: See TracChangeset
for help on using the changeset viewer.