Fix a UI issue on using browser Back button after allowing remote resources (#10062)

This commit is contained in:
Aleksander Machniak
2026-01-04 13:34:43 +01:00
parent 42794a40aa
commit cb7f2d0066
2 changed files with 5 additions and 9 deletions

View File

@@ -8,6 +8,7 @@ This file includes only changes we consider noteworthy for users, admins and plu
- Support X-Forwarded-Host/X-Forwarded-Port in self URLs generation (#9952)
- Support $HasAttachment/$HasNoAttachment keywords for "With attachment" search filter (#10053)
- Password: Extend Dovecot passwdfile driver with dynamic file path support (#10036)
- Fix a UI issue on using browser Back button after allowing remote resources (#10062)
## 1.7-rc2

View File

@@ -2766,11 +2766,7 @@ function rcube_webmail() {
} else {
// "Allow remote resources" reloads the page, we remove this request from the history,
// so Back button works as expected, i.e. ignores the reload request (#6620)
if (safe && document.referrer && window.history.replaceState) {
window.history.replaceState({}, '', document.referrer);
}
this.location_href(url, target, true);
this.location_href(url, target, true, safe && document.referrer);
}
}
};
@@ -9548,7 +9544,7 @@ function rcube_webmail() {
this.redirect(url, lock);
};
this.location_href = function (url, target, frame) {
this.location_href = function (url, target, frame, replace) {
if (frame) {
this.lock_frame(target);
}
@@ -9557,9 +9553,8 @@ function rcube_webmail() {
url = this.env.comm_path + '&' + $.param(url);
}
// simulate real link click to force IE to send referer header
if (bw.ie && target == window) {
$('<a>').attr('href', url).appendTo(document.body).get(0).click();
if (replace) {
target.location.replace(url);
} else {
target.location.href = url;
}