diff --git a/public/templates/account.tpl b/public/templates/account.tpl
index 572b69b0a0..b04c8572f6 100644
--- a/public/templates/account.tpl
+++ b/public/templates/account.tpl
@@ -43,7 +43,7 @@
age
{age}
-
+
member for
{joindate}
@@ -55,9 +55,11 @@
posts
{postcount}
-
+
signature
- {signature}
+
+ {signature}
+
diff --git a/src/routes/user.js b/src/routes/user.js
index 24cbca0306..5ecf0ab27d 100644
--- a/src/routes/user.js
+++ b/src/routes/user.js
@@ -3,7 +3,8 @@
var user = require('./../user.js'),
fs = require('fs'),
utils = require('./../utils.js'),
- config = require('../../config.js');
+ config = require('../../config.js'),
+ marked = require('marked');
(function(User) {
@@ -265,10 +266,15 @@ var user = require('./../user.js'),
});
} else {
getUserDataByUserName(req.params.username, callerUID, function(userData) {
+
user.isFriend(callerUID, userData.theirid, function(isFriend) {
userData.isFriend = isFriend;
+
+ userData.signature = marked(userData.signature || '');
+
res.send(JSON.stringify(userData));
});
+
});
}
diff --git a/src/topics.js b/src/topics.js
index 53d5e0cd63..a5b8389ba8 100644
--- a/src/topics.js
+++ b/src/topics.js
@@ -52,7 +52,7 @@ marked.setOptions({
'username' : user_data[uid].username || 'anonymous',
'user_rep' : user_data[uid].reputation || 0,
'gravatar' : user_data[uid].picture || 'http://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e',
- 'signature' : marked(utils.strip_tags(user_data[uid].signature || '')),
+ 'signature' : marked(user_data[uid].signature || ''),
'fav_star_class' : vote_data[pid] ? 'icon-star' : 'icon-star-empty',
'display_moderator_tools': (uid == current_user || privileges.editable) ? 'show' : 'none',
'edited-class': post_data.editor[i] !== null ? '' : 'none',
diff --git a/src/user.js b/src/user.js
index c57ed091c9..869b75e95c 100644
--- a/src/user.js
+++ b/src/user.js
@@ -100,6 +100,9 @@ var config = require('../config.js'),
User.setUserField(uid, 'gravatarpicture', User.createGravatarURLFromEmail(data[key]));
RDB.set('email:' + data['email'] +':uid', uid);
}
+ else if(key === 'signature') {
+ data[key] = utils.strip_tags(data[key]);
+ }
User.setUserField(uid, key, data[key]);
}