strip tags from signature when they are saving, separated info in user profile and added signature box

v1.18.x
Baris Soner Usakli 12 years ago
parent 26781157b3
commit ef304a712f

@ -43,7 +43,7 @@
<span class="account-bio-label">age</span>
<span>{age}</span>
<br/>
<hr/>
<span class="account-bio-label">member for</span>
<span>{joindate}</span>
<br/>
@ -55,13 +55,15 @@
<span class="account-bio-label">posts</span>
<span id='postcount'>{postcount}</span>
<br/>
<hr/>
<span class="account-bio-label">signature</span>
<div class="post-signature">
<span id='signature'>{signature}</span>
</div>
</div>
</div>
</div>
</div>
<div id="user-actions" class="container">
<a id="add-friend-btn" href="#" class="btn">Follow</a>
</div>

@ -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));
});
});
}

@ -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',

@ -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]);
}

Loading…
Cancel
Save