Просмотр исходного кода

Fix a bug that a redirection after editing a page can't work properly.

Shinya Yamaoka 11 лет назад
Родитель
Сommit
ae444cb209
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      lib/routes/page.js

+ 3 - 2
lib/routes/page.js

@@ -156,12 +156,13 @@ module.exports = function(app) {
         }
         app.set('io').sockets.emit('page edited', {page: data, user: req.user});
 
+        var redirectPath = encodeURI(path);
         if (grant != data.grant) {
           Page.updateGrant(data, grant, req.user, function (err, data) {
-            return res.redirect(path);
+            return res.redirect(redirectPath);
           });
         } else {
-          return res.redirect(path);
+          return res.redirect(redirectPath);
         }
       };
       if (pageData) {