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.
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, '') |
There was a problem hiding this comment.
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
