[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [hobbit] Bug? Possible incorrect escaping of <img> tags in graphs



On Sun, Jun 10, 2007 at 11:51:28PM -0600, Haertig, David F (Dave) wrote:
> After clicking on the graph on the status page to open up the expanded
> page with the 48hr, 12day, 48day and 576day graphs
> the link below is for the first graph on that resulting page.  Notice
> disp=Lantronix sshrseg1
> The space was not represented as %20 like you'd expect.

Thanks for noticing - the attached patch should fix that.


Regards,
Henrik

--- /home/henrik/hobbit/release/hobbit-4.2.0/web/hobbitgraph.c	2007-05-08 14:53:43.000000000 +0200
+++ web/hobbitgraph.c	2007-06-11 09:57:44.000000000 +0200
@@ -545,7 +545,7 @@
 
 	p += sprintf(p, "&amp;service=%s&amp;graph_height=%d&amp;graph_width=%d&amp;color=%s", 
 		     service, graphheight, graphwidth, colorname(bgcolor));
-	if (displayname != hostname) p += sprintf(p, "&amp;disp=%s", displayname);
+	if (displayname != hostname) p += sprintf(p, "&amp;disp=%s", urlencode(displayname));
 	if (firstidx != -1) p += sprintf(p, "&amp;first=%d", firstidx+1);
 	if (idxcount != -1) p += sprintf(p, "&amp;count=%d", idxcount);
 	if (ignorestalerrds) p += sprintf(p, "&amp;nostale");