5
0
mirror of https://github.com/cwinfo/yggdrasil-map synced 2024-11-09 16:00:27 +00:00

Merge pull request #14 from Arceliar/bugfix

Sanitize node names
This commit is contained in:
Arceliar 2019-02-02 14:26:56 -06:00 committed by GitHub
commit 4b5c832df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
from flask import Config from flask import Config
from database import NodeDB from database import NodeDB
import graphPlotter import graphPlotter
import cgi
import urllib, json import urllib, json
url = "http://y.yakamo.org:3000/current" url = "http://y.yakamo.org:3000/current"
@ -36,6 +37,7 @@ def generate_graph(time_limit=60*60*3):
for ip in data: for ip in data:
info = NodeInfo(ip, data[ip][0]) info = NodeInfo(ip, data[ip][0])
if len(data[ip]) >= 3: info.label = data[ip][2] if len(data[ip]) >= 3: info.label = data[ip][2]
info.label = cgi.escape(info.label)
toAdd.append(info) toAdd.append(info)
nodes = dict() nodes = dict()