diff --git a/django/contrib/gis/gdal/tests/test_geom.py b/django/contrib/gis/gdal/tests/test_geom.py
index 9b8ae6a..0410d92 100644
a
|
b
|
class OGRGeomTest(unittest.TestCase, TestDataMixin):
|
116 | 116 | self.assertEqual(json.loads(g.json), json.loads(geom.json)) |
117 | 117 | self.assertEqual(json.loads(g.json), json.loads(geom.geojson)) |
118 | 118 | self.assertEqual(OGRGeometry(g.wkt), OGRGeometry(geom.json)) |
| 119 | # Test input with some garbage content (#15529) |
| 120 | geom = OGRGeometry('{"type": "Point", "coordinates": [ 100.0, 0.0 ], "other": "<test>"}') |
| 121 | self.assertIsInstance(geom, OGRGeometry) |
119 | 122 | |
120 | 123 | def test02_points(self): |
121 | 124 | "Testing Point objects." |
diff --git a/django/contrib/gis/geometry/regex.py b/django/contrib/gis/geometry/regex.py
index 22d16cb..7dbcbfa 100644
a
|
b
|
wkt_regex = re.compile(r'^(SRID=(?P<srid>\-?\d+);)?'
|
9 | 9 | r'(?P<type>POINT|LINESTRING|LINEARRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)' |
10 | 10 | r'[ACEGIMLONPSRUTYZ\d,\.\-\(\) ]+)$', |
11 | 11 | re.I) |
12 | | json_regex = re.compile(r'^(\s+)?\{[\s\w,\[\]\{\}\-\."\':]+\}(\s+)?$') |
| 12 | json_regex = re.compile(r'^(\s+)?\{.*}(\s+)?$', re.DOTALL) |