Skip to content

fix: replace all quotes in get_duration_string_iso#186

Open
polybjorn wants to merge 1 commit into
mpetazzoni:mainfrom
polybjorn:fix-iso-duration-replace-all
Open

fix: replace all quotes in get_duration_string_iso#186
polybjorn wants to merge 1 commit into
mpetazzoni:mainfrom
polybjorn:fix-iso-duration-replace-all

Conversation

@polybjorn

Copy link
Copy Markdown

The two .replace() calls in get_duration_string_iso use string arguments, so each only replaces the first match. The current get_duration_string only emits one of each character, so nothing breaks today, but the next change to the formatter could expose it.

return s.replace(/'/g, ':').replace(/"/g, '');

Same output for every string the current formatter produces. A string with extra quotes like 05'30'45"" now formats to 05:30:45.

Found by CodeQL on a downstream project that vendors leaflet-gpx.

@polybjorn polybjorn marked this pull request as ready for review May 26, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant