--Escape de caracteres al crear xml de cancelacion en el PAC 5

This commit is contained in:
2023-05-03 13:06:20 -07:00
parent bdd6149f11
commit 4403abf4d1
2 changed files with 14 additions and 1 deletions

View File

@@ -865,7 +865,7 @@ Public Class Timbrado
<usuario xmlns="""">{UsuarioServicio}</usuario>
<passwd xmlns="""">{PassServicio}</passwd>
<rfcEmisor xmlns="""">{rfcEmisor}</rfcEmisor>
<arregloUUID xmlns="""">{arregloUUID}|{rfcReceptor}|{rfcEmisor}|{Total}|{MotivoCancelacion}|{FolioSustitucion}</arregloUUID>
<arregloUUID xmlns="""">{arregloUUID}|{rfcReceptor.ToEscapeXML()}|{rfcEmisor.ToEscapeXML()}|{Total}|{MotivoCancelacion}|{FolioSustitucion}</arregloUUID>
<cert xmlns="""">{certBase64}</cert>
<key xmlns="""">{keyBase64}</key>
<keyPass xmlns="""">{keyPass}</keyPass>

View File

@@ -3960,6 +3960,19 @@ Namespace Extensiones
Return text
End Function
<Runtime.CompilerServices.Extension()>
Function ToEscapeXML(ByVal str As String) As String
Dim text As String = ""
text = str.Replace("'", "&apos;")
text = str.Replace("<", "&lt;")
text = str.Replace(">", "&gt;")
text = str.Replace("&", "&amp;")
Return text
End Function
End Module
#End Region