Browse Source

* don't scan embedded images. fixes #40691

(cherry picked from commit 01c6a0c18088a07e5c3d4f15f973298cd0c0ab7a)
marcoonthegit 1 year ago
parent
commit
0d5000d329
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/chm/src/chmfilewriter.pas

+ 3 - 1
packages/chm/src/chmfilewriter.pas

@@ -26,7 +26,7 @@ interface
 
 
 uses
 uses
   Classes, SysUtils, chmwriter, inifiles, contnrs, chmsitemap, avl_tree,
   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;
 
 
 type
 type
   TChmProject = class;
   TChmProject = class;
@@ -825,6 +825,8 @@ var
     val : String;
     val : String;
 begin
 begin
   val := findattribute(node,attributename);
   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 sanitizeurl(fbasepath,val,localpath,localname,fn) then
     if (Length(fn) > 0) { Skip links to self using named anchors }
     if (Length(fn) > 0) { Skip links to self using named anchors }
         and not FileInTotalList(uppercase(fn)) then
         and not FileInTotalList(uppercase(fn)) then