Fix redirect in Message/Reply#_insertMessage if the new URL is the current
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 26 Feb 2019 15:04:02 +0000 (16:04 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 26 Feb 2019 15:04:02 +0000 (16:04 +0100)
This might happen if the AJAX request intentionally returns the URL to
an existing content (e.g. to prevent duplicate content or when performing
automated merges).

wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Message/Reply.js

index e5ef0f4ced3d8a87411c4acfb732162330637c0b..8979bf2a2f61ca6319aaa296492252d2d666b501 100644 (file)
@@ -321,6 +321,9 @@ define(['Ajax', 'Core', 'EventHandler', 'Language', 'Dom/ChangeListener', 'Dom/U
                        //noinspection JSUnresolvedVariable
                        if (data.returnValues.url) {
                                //noinspection JSUnresolvedVariable
+                               if (window.location == data.returnValues.url) {
+                                       window.location.reload();
+                               }
                                window.location = data.returnValues.url;
                        }
                        else {