Zverik / Nik4

Mapnik to image export
Do What The F*ck You Want To Public License
123 stars 23 forks source link

Mind the CDATA when xml-escaping variables #22

Open dooley opened 8 years ago

dooley commented 8 years ago

Can someone please explain why some chars in the vars-parameters are replaced by nik4 (line 157)? This way Postgresql throws an error, because the single quotes in the given sql-fragment are replaced by ' Are there any side-effects if we remove the single-quote replacement?

`

xxx

` nik4.py --vars sql_poly="ST_GeomFromText('POLYGON((9.6101188659668 53.324516580827, 9.6933746337891 53.323081133135, 9.6933746337891 53.294875047878, 9.6104621887207 53.297440007518, 9.6101188659668 53.324516580827))',4326)" ...

Zverik commented 8 years ago

Well, it seems I xml-screen variables, so they don't break XML. I forgot about CDATA. You can fix this by either removing the CDATA frame, or (for now) removing the replacement from the code.

I'll add a check for CDATA a bit later.

dooley commented 8 years ago

I removed that replacing piece of code already on my local instance and so far have not seen any side-effects. But would be nice if we don't have to take care of this when installing on other machines.

And thanks for creating such a useful tool.