Escape DataTable regex searches (fixes #2654)

This commit is contained in:
Bernd Bestel
2025-01-27 17:25:25 +01:00
parent d747a6c86a
commit 1f5263ef22
3 changed files with 6 additions and 4 deletions

View File

@@ -6,11 +6,13 @@
### New Feature: xxxx
- Fixed that the built-in Open Food Facts external barcode lookup plugin used the staging environment of the Open Food Facts API instead of the production one
- xxx
### Stock
- xxx
- Fixed that the built-in Open Food Facts external barcode lookup plugin used the staging environment of the Open Food Facts API instead of the production one
- Fixed that the product group filter on the products page (master data) didn't work when the selected product group contained special characters
- Fixed that the product filter on the stock journal summary page didn't work when the selected product contained special characters
### Shopping list

View File

@@ -32,7 +32,7 @@ $("#product-group-filter").on("change", function()
}
else
{
productsTable.column(productsTable.colReorder.transpose(6)).search("^" + value + "$", true, false).draw();
productsTable.column(productsTable.colReorder.transpose(6)).search("^" + $.fn.dataTable.util.escapeRegex(value) + "$", true, false).draw();
}
});

View File

@@ -18,7 +18,7 @@ $("#product-filter").on("change", function()
}
else
{
journalSummaryTable.column(journalSummaryTable.colReorder.transpose(1)).search("^" + text + "$", true, false).draw();
journalSummaryTable.column(journalSummaryTable.colReorder.transpose(1)).search("^" + $.fn.dataTable.util.escapeRegex(text) + "$", true, false).draw();
}
});