Skip to content

Commit

Permalink
fields: Fix escaping of regular expressions patterns (TEDEFO-3728)
Browse files Browse the repository at this point in the history
The patterns were incorrectly escaped for XML in fields.json, leading to
incorrect matches if interpreted literally.

Just escape what is needed for JSON: " to \".
So "&" is replaced by "&", and """ by "\"".

Fixes #1019
  • Loading branch information
bertrand-lorentz committed Sep 17, 2024
1 parent 1d157b0 commit 40406ef
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions fields/fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"ublVersion" : "2.3",
"sdkVersion" : "eforms-sdk-1.13.0-SNAPSHOT",
"metadataDatabase" : {
"version" : "1.12.301",
"createdOn" : "2024-09-16T15:41:03"
"version" : "1.12.307",
"createdOn" : "2024-09-17T11:22:34"
},
"businessEntities" : [ {
"id" : "buyer",
Expand Down Expand Up @@ -4266,7 +4266,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -4295,7 +4295,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -4324,7 +4324,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -6380,7 +6380,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -6423,7 +6423,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -6668,7 +6668,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -7453,7 +7453,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24253,7 +24253,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24282,7 +24282,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24311,7 +24311,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24340,7 +24340,7 @@
} ]
},
"pattern" : {
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24379,7 +24379,7 @@
} ]
},
"pattern" : {
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24423,7 +24423,7 @@
} ]
},
"pattern" : {
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24457,7 +24457,7 @@
} ]
},
"pattern" : {
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24953,7 +24953,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -24982,7 +24982,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -25026,7 +25026,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -29068,7 +29068,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -29111,7 +29111,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -36038,7 +36038,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -39247,7 +39247,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -39417,7 +39417,7 @@
} ]
},
"pattern" : {
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"value" : "^[A-Za-z0-9!#$%&''*+/=?_-]+(\\.[A-Za-z0-9!#$%&''*+/=?_-]+)*@([A-Za-z0-9]([A-Za-z0-9_-]*[A-Za-z0-9])?\\.)+([A-Za-z]{2,})$",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -40025,7 +40025,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -40053,7 +40053,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -40273,7 +40273,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -40301,7 +40301,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -40329,7 +40329,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down Expand Up @@ -40357,7 +40357,7 @@
} ]
},
"pattern" : {
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@"\\(\\)&]+",
"value" : "((^(http|HTTP|https|HTTPS|ftp|FTP|ftps|FTPS|sftp|SFTP)://)|(^(w|W){3}(\\d)?\\.))[\\w\\?!\\./:;,\\-_=#+*%@\"\\(\\)&]+",
"severity" : "ERROR"
}
}, {
Expand Down

0 comments on commit 40406ef

Please sign in to comment.