fix: search not indexing properly + cjk/arabic validators

This commit is contained in:
NGPixel
2017-05-14 11:24:05 -04:00
parent 8f974a3ac7
commit f5aa726cd5
12 changed files with 26 additions and 23 deletions

View File

@@ -14,7 +14,7 @@ module.exports = {
*/
parsePath (urlPath) {
urlPath = qs.unescape(urlPath)
let wlist = new RegExp('(?!([^a-z0-9]|' + appdata.regex.cjk.source + '|[/-]))', 'g')
let wlist = new RegExp('[^a-z0-9' + appdata.regex.cjk + appdata.regex.arabic + '/-]', 'g')
urlPath = _.toLower(urlPath).replace(wlist, '')

View File

@@ -6,7 +6,7 @@ const _ = require('lodash')
module.exports = {
sanitizeCommitUser (user) {
let wlist = new RegExp('(?!([^a-zA-Z0-9-_.\',& ]|' + appdata.regex.cjk.source + '))', 'g')
let wlist = new RegExp('[^a-zA-Z0-9-_.\',& ' + appdata.regex.cjk + appdata.regex.arabic + ']', 'g')
return {
name: _.chain(user.name).replace(wlist, '').trim().value(),
email: appconfig.git.showUserEmail ? user.email : appconfig.git.serverEmail