Skip to content

Commit 1f9df00

Browse files
tux3benapetr
authored andcommitted
fix(ReportUser::checkUserIsReported): Always failed with Qt6
QRegularExpression has a different behavior, here it would only match the single line where the user was reported, even though the pattern is .*$username.* Add the option for DotMatchesEverything, which will match all lines
1 parent 4eb0678 commit 1f9df00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/huggle_ui/reportuser.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,11 +599,12 @@ bool ReportUser::checkUserIsReported()
599599
{
600600
QString regex = this->reportedUser->GetSite()->GetProjectConfig()->ReportUserCheckPattern;
601601
regex.replace("$username", HREGEX_TYPE::escape(this->reportedUser->Username));
602-
HREGEX_TYPE pattern(regex);
603602
#ifdef QT6_BUILD
603+
HREGEX_TYPE pattern(regex, QRegularExpression::DotMatchesEverythingOption);
604604
QRegularExpressionMatch match = pattern.match(this->reportContent);
605605
return match.hasMatch() && (match.captured(0) == this->reportContent);
606606
#else
607+
HREGEX_TYPE pattern(regex);
607608
return pattern.exactMatch(this->reportContent);
608609
#endif
609610
}

0 commit comments

Comments
 (0)