File tree Expand file tree Collapse file tree
src/Elastic.Documentation.Configuration/Builder Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111using Elastic . Documentation . Diagnostics ;
1212using Elastic . Documentation . Extensions ;
1313using Elastic . Documentation . Links ;
14+ using static Elastic . Documentation . Configuration . SymlinkValidator ;
1415
1516namespace Elastic . Documentation . Configuration . Builder ;
1617
@@ -330,10 +331,11 @@ private static BrandingConfiguration ValidateBranding(BrandingConfiguration bran
330331 return null ;
331332 }
332333
333- if ( resolved . LinkTarget is not null )
334+ var symlinkError = ValidateFileAccess ( resolved , context . DocumentationSourceDirectory ) ;
335+ if ( symlinkError is not null )
334336 {
335337 context . EmitError ( context . ConfigurationPath ,
336- $ "'{ fieldName } ' path '{ imagePath } ' is a symbolic link, which is not allowed for branding images. ") ;
338+ $ "'{ fieldName } ' path '{ imagePath } ' is unsafe: { symlinkError } ") ;
337339 return null ;
338340 }
339341
You can’t perform that action at this time.
0 commit comments