mattetti / googlecharts

Ruby Google Chart API
http://mattetti.github.com/googlecharts/
MIT License
699 stars 108 forks source link

Special characters aren't escaped correctly #3

Closed der-flo closed 14 years ago

der-flo commented 15 years ago

I found this bug when adding an ampersand to a legend string. Perhaps you as the maintainer can fix this issue with CGI.escape. I tried to integrate it, but I'm not exactly sure where to substitute. The method GChart.jstize is the wrong place because of already applied parameter concatenation. GChart#query_builder seems to be a better place ...

If you have no time to fix it by yourself or accept a hackish version, please drop me a note. Then I would try my best.

Thanks, der_flo

mattetti commented 15 years ago

The best thing would be to write a quick failing spec to show what the problem is, I would be glad to fix it if I can easily reproduce the problem.

Thanks,

der-flo commented 15 years ago

Ok, no problem, you'll get it until tomorrow.

der_flo

der-flo commented 15 years ago

Here you have a quick (failing) spec addition: http://gist.github.com/99988

Here you have a somewhat hackish patch for legends: http://github.com/der-flo/googlecharts/commit/8004aeb6999cf9bcc40bfe38b42e0feaebeacee1 It should be applied in more places, perhaps you have a good idea.

Thanks and bye, der_flo

mattetti commented 14 years ago

this is now fixed and available in 1.5 (sorry for the delay)

mattetti commented 14 years ago

fixed