зеркало из https://github.com/mozilla/gecko-dev.git
bug 238045 - Cookie manager of 1.7beta does not display stored cookies, r=mvl, sr=darin, a=chofmann, display a blank value for expiry if FormatDateTime chokes on really long-lived cookies
This commit is contained in:
Родитель
aef3144b57
Коммит
c48af3a33a
|
@ -197,15 +197,22 @@ function cookieDeny()
|
|||
|
||||
function GetExpiresString(secondsUntilExpires) {
|
||||
if (secondsUntilExpires) {
|
||||
var expireDate = new Date(1000*secondsUntilExpires);
|
||||
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds,
|
||||
expireDate.getFullYear(),
|
||||
expireDate.getMonth()+1,
|
||||
expireDate.getDate(),
|
||||
expireDate.getHours(),
|
||||
expireDate.getMinutes(),
|
||||
expireDate.getSeconds());
|
||||
var date = new Date(1000*secondsUntilExpires);
|
||||
|
||||
// if a server manages to set a really long-lived cookie, the dateservice
|
||||
// can't cope with it properly, so we'll just return a blank string
|
||||
// see bug 238045 for details
|
||||
var expiry = "";
|
||||
try {
|
||||
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds,
|
||||
date.getFullYear(), date.getMonth()+1,
|
||||
date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
} catch(ex) {
|
||||
// do nothing
|
||||
}
|
||||
return expiry;
|
||||
}
|
||||
return cookieBundle.getString("atEndOfSession");
|
||||
}
|
||||
|
|
|
@ -276,10 +276,21 @@ function loadCookies() {
|
|||
function GetExpiresString(expires) {
|
||||
if (expires) {
|
||||
var date = new Date(1000*expires);
|
||||
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds, date.getFullYear(),
|
||||
date.getMonth()+1, date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
|
||||
// if a server manages to set a really long-lived cookie, the dateservice
|
||||
// can't cope with it properly, so we'll just return a blank string
|
||||
// see bug 238045 for details
|
||||
var expiry = "";
|
||||
try {
|
||||
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds,
|
||||
date.getFullYear(), date.getMonth()+1,
|
||||
date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
} catch(ex) {
|
||||
// do nothing
|
||||
}
|
||||
return expiry;
|
||||
}
|
||||
return cookieBundle.getString("AtEndOfSession");
|
||||
}
|
||||
|
|
|
@ -197,15 +197,22 @@ function cookieDeny()
|
|||
|
||||
function GetExpiresString(secondsUntilExpires) {
|
||||
if (secondsUntilExpires) {
|
||||
var expireDate = new Date(1000*secondsUntilExpires);
|
||||
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds,
|
||||
expireDate.getFullYear(),
|
||||
expireDate.getMonth()+1,
|
||||
expireDate.getDate(),
|
||||
expireDate.getHours(),
|
||||
expireDate.getMinutes(),
|
||||
expireDate.getSeconds());
|
||||
var date = new Date(1000*secondsUntilExpires);
|
||||
|
||||
// if a server manages to set a really long-lived cookie, the dateservice
|
||||
// can't cope with it properly, so we'll just return a blank string
|
||||
// see bug 238045 for details
|
||||
var expiry = "";
|
||||
try {
|
||||
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds,
|
||||
date.getFullYear(), date.getMonth()+1,
|
||||
date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
} catch(ex) {
|
||||
// do nothing
|
||||
}
|
||||
return expiry;
|
||||
}
|
||||
return cookieBundle.getString("atEndOfSession");
|
||||
}
|
||||
|
|
|
@ -276,10 +276,21 @@ function loadCookies() {
|
|||
function GetExpiresString(expires) {
|
||||
if (expires) {
|
||||
var date = new Date(1000*expires);
|
||||
return gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds, date.getFullYear(),
|
||||
date.getMonth()+1, date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
|
||||
// if a server manages to set a really long-lived cookie, the dateservice
|
||||
// can't cope with it properly, so we'll just return a blank string
|
||||
// see bug 238045 for details
|
||||
var expiry = "";
|
||||
try {
|
||||
expiry = gDateService.FormatDateTime("", gDateService.dateFormatLong,
|
||||
gDateService.timeFormatSeconds,
|
||||
date.getFullYear(), date.getMonth()+1,
|
||||
date.getDate(), date.getHours(),
|
||||
date.getMinutes(), date.getSeconds());
|
||||
} catch(ex) {
|
||||
// do nothing
|
||||
}
|
||||
return expiry;
|
||||
}
|
||||
return cookieBundle.getString("AtEndOfSession");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче