mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Fix: Combination of status filters on invoices page causes 500 fatal server error (Fix #6437)
This commit is contained in:
@@ -6,6 +6,7 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Net;
|
||||
using System.Net.WebSockets;
|
||||
using System.Reflection;
|
||||
@@ -625,6 +626,23 @@ namespace BTCPayServer
|
||||
return supportedChains.Contains(cryptoCode.ToUpperInvariant());
|
||||
}
|
||||
|
||||
class ParameterReplacer : ExpressionVisitor
|
||||
{
|
||||
private Dictionary<string, ParameterExpression> _Parameters;
|
||||
|
||||
protected override Expression VisitLambda<T>(Expression<T> node)
|
||||
{
|
||||
_Parameters = node.Parameters.ToDictionary(p => p.Name);
|
||||
return base.VisitLambda(node);
|
||||
}
|
||||
protected override Expression VisitParameter(ParameterExpression node)
|
||||
{
|
||||
return _Parameters[node.Name];
|
||||
}
|
||||
}
|
||||
public static TExpr ReplaceParameterRef<TExpr>(this TExpr expression) where TExpr : Expression
|
||||
=> (TExpr)new ParameterReplacer().Visit(expression);
|
||||
|
||||
public static IActionResult RedirectToRecoverySeedBackup(this Controller controller, RecoverySeedBackupViewModel vm)
|
||||
{
|
||||
var redirectVm = new PostRedirectViewModel
|
||||
|
||||
Reference in New Issue
Block a user