[PR #1642] Fix Issue#1235: Sanitize XML comment to prevent invalid token errors #2355

Closed
opened 2026-01-29 17:21:42 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1642

State: closed
Merged: No


Fix Issue#1235: Sanitize XML comment to prevent invalid token errors

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I absolutely love CCExtractor, but have not contributed previously.

Pull Requests Description :

  • Added logic to detect and replace any occurrence of "--" in comments with a single "-" to ensure valid XML.
  • Used a bulk write ('fwrite') to efficiently handle portions of the string that don't contain invalid sequences.
  • Ensured that comments are written correctly without altering the original structure of the code.
  • Updated function 'write_spucomment' to handle the sanitization process efficiently.
**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1642 **State:** closed **Merged:** No --- # Fix Issue#1235: Sanitize XML comment to prevent invalid token errors **In raising this pull request, I confirm the following (please check boxes):** - [ ] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [ ] I have checked that another pull request for this purpose does not exist. - [ ] I have considered, and confirmed that this submission will be valuable to others. - [ ] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [ ] I give this submission freely, and claim no ownership to its content. - [ ] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I absolutely love CCExtractor, but have not contributed previously. --- ## Pull Requests Description : - Added logic to detect and replace any occurrence of "--" in comments with a single "-" to ensure valid XML. - Used a bulk write ('fwrite') to efficiently handle portions of the string that don't contain invalid sequences. - Ensured that comments are written correctly without altering the original structure of the code. - Updated function 'write_spucomment' to handle the sanitization process efficiently.
claunia added the pull-request label 2026-01-29 17:21:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2355