bugGNU Wget - Bugs: bug #66430, --convert-links breaks HTML by...

 
 

bug #66430: --convert-links breaks HTML by decoding a percent-encoded single quote inside single quotes

Submitter:  None
Submitted:  Sat 09 Nov 2024 12:17:10 AM UTC
   
 
Category:  Program Logic Severity:  3 - Normal
Priority:  5 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  None
Operating System:  None Reproducibility:  Every Time
Fixed Release:  None Planned Release:  None
Regression:  None Work Required:  None
Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 09 Nov 2024 12:17:10 AM UTC, original submission:  

wget 1.24.5
Consider HTML with following content:

... <a href='joe%27s_page.html'>Joe's page</a>. ..

When downloading this page and the one linked in href with --convert-links, the above HTML gets converted to:

... <a href='joe's_page.html'>Joe's page</a> ...

Notice how %27 got decoded to a literal "'" inside an already single quoted link, thus breaking the link.
A quick hack of src/convert.c:local_quote_string() to encode "'" back into %27 seems to fix local viewing for me.
However, i have no knowledge of wget's internals and don't know if this could be considered a proper fix.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by None (Submitted the item)
  •  

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.14-04e1.
    Corresponding source code