From 01c6a0c18088a07e5c3d4f15f973298cd0c0ab7a Mon Sep 17 00:00:00 2001 From: marcoonthegit Date: Sat, 16 Mar 2024 19:28:47 +0100 Subject: [PATCH] * don't scan embedded images. fixes #40691 --- packages/chm/src/chmfilewriter.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/chm/src/chmfilewriter.pas b/packages/chm/src/chmfilewriter.pas index cd3a876a29..b408330232 100644 --- a/packages/chm/src/chmfilewriter.pas +++ b/packages/chm/src/chmfilewriter.pas @@ -29,11 +29,11 @@ interface {$IFDEF FPC_DOTTEDUNITS} uses System.Classes, System.SysUtils, Chm.Writer, System.IniFiles, System.Contnrs, Chm.Sitemap, Fcl.AVLTree, - {for html scanning } Xml.Dom, Html.Sax, Html.Dom; + {for html scanning } Xml.Dom, Html.Sax, Html.Dom, System.StrUtils; {$ELSE FPC_DOTTEDUNITS} uses Classes, SysUtils, chmwriter, inifiles, contnrs, chmsitemap, avl_tree, - {for html scanning } dom,SAX_HTML,dom_html; + {for html scanning } dom,SAX_HTML,dom_html,strutils; {$ENDIF FPC_DOTTEDUNITS} type @@ -837,6 +837,8 @@ var val : String; begin val := findattribute(node,attributename); + if startstext('data:',val) then // skip embedded base64 or uuencoded images. + exit; if sanitizeurl(fbasepath,val,localpath,localname,fn) then if (Length(fn) > 0) { Skip links to self using named anchors } and not FileInTotalList(uppercase(fn)) then