Backport: fix for GIS escaping