You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
402 B

  1. 'use strict'
  2. /* global appdata, appconfig */
  3. const _ = require('lodash')
  4. module.exports = {
  5. sanitizeCommitUser (user) {
  6. let wlist = new RegExp('[^a-zA-Z0-9-_.\',& ' + appdata.regex.cjk + appdata.regex.arabic + ']', 'g')
  7. return {
  8. name: _.chain(user.name).replace(wlist, '').trim().value(),
  9. email: appconfig.git.showUserEmail ? user.email : appconfig.git.serverEmail
  10. }
  11. }
  12. }