Fixed encoding issue with desktop notification
authorAlexander Ebert <ebert@woltlab.com>
Thu, 31 Aug 2017 15:33:18 +0000 (17:33 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 31 Aug 2017 15:33:24 +0000 (17:33 +0200)
wcfsetup/install/files/js/WoltLabSuite/Core/Notification/Handler.js
wcfsetup/install/files/lib/data/session/SessionAction.class.php

index 63c768893179e9d3cb1cb85c5e0237c583c70e00..d02eec35d2a844b59bb8c4f85bd189a5450b0998 100644 (file)
@@ -7,7 +7,7 @@
  * @license     GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
  * @module      WoltLabSuite/Core/Notification/Handler
  */
-define(['Ajax', 'Core', 'EventHandler'], function(Ajax, Core, EventHandler) {
+define(['Ajax', 'Core', 'EventHandler', 'StringUtil'], function(Ajax, Core, EventHandler, StringUtil) {
        "use strict";
        
        if (!('Promise' in window) || !('Notification' in window)) {
@@ -225,7 +225,7 @@ define(['Ajax', 'Core', 'EventHandler'], function(Ajax, Core, EventHandler) {
                        if (typeof pollData.notification === 'object' && typeof pollData.notification.message ===  'string') {
                                //noinspection JSUnresolvedVariable
                                var notification = new window.Notification(pollData.notification.title, {
-                                       body: pollData.notification.message,
+                                       body: StringUtil.unescapeHTML(pollData.notification.message),
                                        icon: _icon
                                });
                                notification.onclick = function () {
index 719b6f69805266b6ca33e6068956b9b6d0acf824..7604b5bf63727c90007021a87994055ff9f40ccf 100644 (file)
@@ -52,8 +52,7 @@ class SessionAction extends AbstractDatabaseObjectAction {
        public function keepAlive() {
                // ignore sessions created by this request
                if (WCF::getSession()->lastActivityTime == TIME_NOW) {
-                       // TODO: DEBUG ONLY
-                       //return [];
+                       return [];
                }
                
                // update last activity time