[PR #1641] [CLOSED] Fix: Sanitize XML comment to prevent invalid token errors #2349

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

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1641
Author: @ShobikaG
Created: 9/15/2024
Status: Closed

Base: masterHead: patch-1


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 docs/CHANGES.TXT (+1 -0)

📄 Description

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 :

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

Pull Request 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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1641 **Author:** [@ShobikaG](https://github.com/ShobikaG) **Created:** 9/15/2024 **Status:** ❌ Closed **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`54e07ee`](https://github.com/CCExtractor/ccextractor/commit/54e07ee4635776ecbac419ec65f62dc62d5fd059) Update CHANGES.TXT ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/CHANGES.TXT` (+1 -0) </details> ### 📄 Description # 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 :** - [ ] I absolutely love CCExtractor, but have not contributed previously. --- ## Pull Request 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:21:41 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2349