Jobs: escape attachment paths
This commit is contained in:
parent
882824d80f
commit
b614b3f140
@ -83,13 +83,14 @@ Public Class EmailFunctions
|
|||||||
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT.Replace(EmailStrings.constNAME_ZUGFERD_PORTAL, NamePortal), oCompleteBodyText)
|
Dim oFinalBodyText = String.Format(EmailStrings.EMAIL_WRAPPING_TEXT.Replace(EmailStrings.constNAME_ZUGFERD_PORTAL, NamePortal), oCompleteBodyText)
|
||||||
|
|
||||||
Dim oEmailAddress = pEmailData.From
|
Dim oEmailAddress = pEmailData.From
|
||||||
Dim oAttachment = pEmailData.Attachment
|
Dim oAttachmentPath = pEmailData.Attachment
|
||||||
If oAttachment <> String.Empty Then
|
If oAttachmentPath <> String.Empty Then
|
||||||
_logger.Debug($"Attachment_String [{oAttachment}]!")
|
_logger.Debug($"Attachment_String [{oAttachmentPath}]!")
|
||||||
If IO.File.Exists(oAttachment) = False Then
|
If IO.File.Exists(oAttachmentPath) = False Then
|
||||||
_logger.Info($"Attachment.File [{oAttachment}] is not existing!!!")
|
_logger.Info($"Attachment.File [{oAttachmentPath}] is not existing!!!")
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
Dim oAttachmentPathEscaped = oAttachmentPath.Replace("'", "''")
|
||||||
|
|
||||||
If IsNothing(oEmailAddress) OrElse String.IsNullOrWhiteSpace(oEmailAddress) Then
|
If IsNothing(oEmailAddress) OrElse String.IsNullOrWhiteSpace(oEmailAddress) Then
|
||||||
_logger.Warn("Could not find email-address for MessageId {0}", MessageId)
|
_logger.Warn("Could not find email-address for MessageId {0}", MessageId)
|
||||||
@ -133,7 +134,7 @@ Public Class EmailFunctions
|
|||||||
,'{oFinalBodyText}'
|
,'{oFinalBodyText}'
|
||||||
,'{SourceProcedure}'
|
,'{SourceProcedure}'
|
||||||
,'{oCreatedWho}'
|
,'{oCreatedWho}'
|
||||||
,'{oAttachment}')"
|
,'{oAttachmentPathEscaped}')"
|
||||||
_mssql.ExecuteNonQuery(oInsert)
|
_mssql.ExecuteNonQuery(oInsert)
|
||||||
Else
|
Else
|
||||||
'If oDTResult.Rows.Count = 0 Then
|
'If oDTResult.Rows.Count = 0 Then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user