Fixed a couple of SonarQube issues.

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

No files matched your search

@@ -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;