Merge remote-tracking branch 'origin/master' into socket.io1.x

v1.18.x
barisusakli 10 years ago
commit 647b15c7ef

@ -8,7 +8,7 @@ var async = require('async'),
meta = require('../meta'),
websockets = require('../socket.io'),
postTools = require('../postTools'),
plugins = require('../plugins')
plugins = require('../plugins');
module.exports = function(Posts) {
@ -61,6 +61,7 @@ module.exports = function(Posts) {
}
userData.custom_profile_info = results.customProfileInfo.profile;
userData.signature = sanitizeSignature(userData.signature);
plugins.fireHook('filter:posts.modifyUserInfo', userData, next);
});
@ -105,3 +106,18 @@ module.exports = function(Posts) {
});
};
};
function sanitizeSignature(signature) {
var string = require('string')(signature),
tagsToStrip = [];
if (parseInt(meta.config['signatures:disableLinks'], 10) === 1) {
tagsToStrip.push('a');
}
if (parseInt(meta.config['signatures:disableImages'], 10) === 1) {
tagsToStrip.push('img');
}
return tagsToStrip.length ? string.stripTags.apply(string, tagsToStrip).s : signature;
}

@ -41,11 +41,33 @@
<label>Minimum Post Length</label>
<input type="number" class="form-control" value="8" data-field="minimumPostLength">
</div>
</form>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Signature Settings</div>
<div class="panel-body">
<form>
<div class="checkbox">
<label>
<input type="checkbox" data-field="disableSignatures"> <strong>Disable signatures</strong>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" data-field="signatures:disableLinks"> <strong>Disable links in signatures</strong>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" data-field="signatures:disableImages"> <strong>Disable images in signatures</strong>
</label>
</div>
<div class="form-group">
<label>Maximum Signature Length</label>
<input type="text" class="form-control" value="255" data-field="maximumSignatureLength">
</div>
</form>
</div>
</div>

@ -133,10 +133,6 @@
<label>Minimum Password Length</label>
<input type="text" class="form-control" value="6" data-field="minimumPasswordLength">
</div>
<div class="form-group">
<label>Maximum Signature Length</label>
<input type="text" class="form-control" value="255" data-field="maximumSignatureLength">
</div>
<div class="form-group">
<label>Forum Terms of Use <small>(Leave blank to disable)</small></label>
<textarea class="form-control" data-field="termsOfUse"></textarea>

Loading…
Cancel
Save