Merge branch 'master' into unify-taglists

This commit is contained in:
Kiwi
2017-06-26 19:08:38 +07:00
committed by GitHub
3 changed files with 24 additions and 2 deletions
+22
View File
@@ -66,6 +66,28 @@ const validation = (formData, dispatch, next) => {
return;
}
// Confirm Validation
const prefixLength = 'confirm'.length;
const confirm = validKeys
.filter((name) => {
if (!name.startsWith('confirm')) {
return false;
}
// Check that 'confirmX' equals 'X'.
const other = name.substr(prefixLength, 1).toLowerCase() + name.substr(prefixLength + 1);
const cond = formData[other] !== formData[name];
if (cond) {
dispatch(addError(name, errorMsj[name]));
}
return cond;
});
if (confirm.length) {
dispatch(hasError());
return;
}
dispatch(clearErrors());
next();
};
@@ -48,7 +48,7 @@ const InitialStep = (props) => {
label={t('install.create.confirm_password')}
onChange={handleUserChange}
showErrors={install.showErrors}
errorMsg={install.errors.confirm_password}
errorMsg={install.errors.confirmPassword}
/>
{
@@ -54,7 +54,7 @@ class Comment extends React.Component {
// currently the highlighter plugin does not support out of the box.
const searchWords = [...suspectWords, ...bannedWords]
.filter((w) => {
return new RegExp(`(^|\\s)${w}(\\s|$)`).test(comment.body);
return new RegExp(`(^|\\s)${w}(\\s|$)`, 'i').test(comment.body);
})
.concat(linkText);