-
-
Notifications
You must be signed in to change notification settings - Fork 81
Escape gpx xml #1186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Escape gpx xml #1186
Conversation
Ensures route names and descriptions are properly escaped when generating GPX files, preventing potential XML parsing issues. Sanitizes the filename to be downloaded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds XML escaping and filename sanitization to the GPX file generation feature to prevent XML parsing errors and filesystem issues.
- Implements XML special character escaping for route names and descriptions
- Adds filename sanitization to remove invalid filesystem characters
- Applies escaping to GPX XML content and download filenames
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/features/route/RoutePopup.jsx
Outdated
|
|
||
| const sanitizeFilename = (name = '') => | ||
| String(name) | ||
| .replace(/[\/:*?"<>|]/g, '') |
Copilot
AI
Jan 8, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sanitizeFilename function is missing the backslash character '' in the regex pattern. The current pattern [\/:*?"<>|] includes forward slash but not backslash, which is also an invalid filename character on Windows and should be removed. The pattern should be [\\/:*?"<>|] to include both forward slash and backslash.
| .replace(/[\/:*?"<>|]/g, '') | |
| .replace(/[\\/:*?"<>|]/g, '') |
# [1.41.0-develop.5](v1.41.0-develop.4...v1.41.0-develop.5) (2026-01-08) ### Bug Fixes * escape gpx xml ([#1186](#1186)) ([7bd5ce1](7bd5ce1))
|
🎉 This PR is included in version 1.41.0-develop.5 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Ensures route names and descriptions are properly escaped when generating GPX files, preventing potential XML parsing issues. Sanitizes the filename to be downloaded.

I was getting this error on this website: https://www.freeformatter.com/xml-validator-xsd.html
