cardigann: ignore disabled or unchecked inputs in login (#14338)

This commit is contained in:
Bogdan 2023-05-20 02:50:55 +03:00 committed by GitHub
parent 7e33461c7f
commit a012c9d686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -9,8 +9,10 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using AngleSharp.Dom;
using AngleSharp.Html;
using AngleSharp.Html.Dom;
using AngleSharp.Html.Parser;
using AngleSharp.Text;
using AngleSharp.Xml.Parser;
using Jackett.Common.Helpers;
using Jackett.Common.Models;
@ -608,8 +610,18 @@ namespace Jackett.Common.Indexers
foreach (var input in inputs)
{
var name = input.GetAttribute("name");
if (name == null)
if (name == null || input.IsDisabled())
{
continue;
}
if (input is IHtmlInputElement element &&
element.Type.IsOneOf(InputTypeNames.Checkbox, InputTypeNames.Radio) &&
!input.IsChecked())
{
continue;
}
var value = input.GetAttribute("value") ?? "";