Skip to content

Escape quotes in locality name for GEOLocate integration#7927

Open
foozleface wants to merge 1 commit intospecify:mainfrom
calacademy-research:fix-7664
Open

Escape quotes in locality name for GEOLocate integration#7927
foozleface wants to merge 1 commit intospecify:mainfrom
calacademy-research:fix-7664

Conversation

@foozleface
Copy link
Copy Markdown
Collaborator

Fixes #7664
Contributed by @foozleface

Locality names containing single or double quotes break the GEOLocate plugin because its internal page scripts cannot handle embedded quote characters in URL parameters, causing the map to fail to render.

Implementation

  • Add sanitizeGeoLocateData() helper that strips " and ' characters from all data values before they are passed to the GEOLocate URL builder
  • Apply the sanitizer in GenericGeoLocate when constructing the URL, replacing the direct ...data spread with ...sanitizeGeoLocateData(data)
  • Add unit tests covering double quotes, single quotes, mixed quotes, passthrough of clean values, and sanitization across all fields including the points parameter

Testing instructions

  • Create or find a locality record with quotes in the name (e.g., Near "Big Rock" Creek or O'Brien's Landing)
  • Open the GEOLocate plugin from that locality record
  • Verify the GEOLocate map renders correctly without JavaScript errors
  • Verify that locality names without quotes continue to work normally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 📋Back Log

Development

Successfully merging this pull request may close these issues.

GEOLocate fails to display a map when a Locality name has a " or ' character

1 participant