nuxsmin / sysMonDash

Systems Monitor Dashboard, monitoring dashboard for Nagios, Icinga Check_MK and Zabbix
GNU General Public License v3.0
34 stars 14 forks source link

TCP addresses are not parsed properly #25

Open widders opened 7 years ago

widders commented 7 years ago

TCP addresses with '-' characters (and other legal non-word characters) are not parsed properly in the regex for getUrl() in SocketTCP.

Additional characters need to be in the match group, escaped '-' for our particular problem but maybe there are more characters not included (underscore etc..)

nuxsmin commented 7 years ago

Hello!

You're right, minus sign should be allowed.

The regex used for getting the URL is '#^https?://([\w.:]+)/?#' so it will match all hostnames that include either upper and lower case letters, numbers, dots or underscores (https://en.wikipedia.org/wiki/Regular_expression#Character_classes), but there are some restrictions about hostnames https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_hostnames

Thanks for the feedback!