1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-02-01 03:48:27 +00:00

Validate regex patterns in global search

This commit is contained in:
Aussiemon 2026-01-22 16:49:46 -07:00
parent 851f69609f
commit ca1dbb7437

View file

@ -17,13 +17,21 @@ void CSVTools::SearchBox::updateSearchButton()
switch (mMode.currentIndex())
{
case 0:
case 1:
case 2:
case 3:
mSearch.setEnabled(!mText.text().isEmpty());
break;
case 1:
case 3:
{
if (mText.text().isEmpty())
mSearch.setEnabled(false);
else
mSearch.setEnabled(QRegularExpression(mText.text()).isValid());
break;
}
case 4:
mSearch.setEnabled(true);