mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Make sure tags does not contains ','
This commit is contained in:
@@ -130,7 +130,7 @@ namespace BTCPayServer.Controllers
|
|||||||
var walletTransactionsInfo = await walletTransactionsInfoAsync;
|
var walletTransactionsInfo = await walletTransactionsInfoAsync;
|
||||||
if (addlabel != null)
|
if (addlabel != null)
|
||||||
{
|
{
|
||||||
addlabel = addlabel.Trim().ToLowerInvariant().Truncate(MaxLabelSize);
|
addlabel = addlabel.Trim().ToLowerInvariant().Replace(',',' ').Truncate(MaxLabelSize);
|
||||||
var labels = walletBlobInfo.GetLabels();
|
var labels = walletBlobInfo.GetLabels();
|
||||||
if (!walletTransactionsInfo.TryGetValue(transactionId, out var walletTransactionInfo))
|
if (!walletTransactionsInfo.TryGetValue(transactionId, out var walletTransactionInfo))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ namespace BTCPayServer.Data
|
|||||||
Blob = Array.Empty<byte>();
|
Blob = Array.Empty<byte>();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (blobInfo.Labels.Any(l => l.Contains(',', StringComparison.OrdinalIgnoreCase)))
|
||||||
|
throw new ArgumentException(paramName: nameof(blobInfo), message: "Labels must not contains ','");
|
||||||
Labels = String.Join(',', blobInfo.Labels);
|
Labels = String.Join(',', blobInfo.Labels);
|
||||||
Blob = ZipUtils.Zip(JsonConvert.SerializeObject(blobInfo));
|
Blob = ZipUtils.Zip(JsonConvert.SerializeObject(blobInfo));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user