Fixed a couple of SonarQube issues.

This commit is contained in:
Aditya Toshniwal
2022-09-10 14:04:28 +05:30
committed by Akshay Joshi
parent 43022b7aa2
commit b128ba2f57
16 changed files with 175 additions and 145 deletions

View File

@@ -466,7 +466,7 @@ export default class ServerSchema extends BaseUISchema {
/* Hostname, IP address validate */
if (state.host) {
// Check for leading and trailing spaces.
if (/^\s|\s$/.test(state.host)){
if (/(^\s)|(\s$)/.test(state.host)){
errmsg = gettext('Host name must be valid hostname or IPv4 or IPv6 address.');
setError('host', errmsg);
return true;