From 79dbe261c53d6f96c154b45df6149e7c29ed146e Mon Sep 17 00:00:00 2001 From: sujon Date: Tue, 15 Nov 2022 23:03:29 +0600 Subject: [PATCH 1/2] found a scenario where the data table search box can't search the value consisting of '&' though the data exists in the table. Fixed the issue. --- src/DataTableAbstract.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/DataTableAbstract.php b/src/DataTableAbstract.php index 2256ed5f..8db6833b 100644 --- a/src/DataTableAbstract.php +++ b/src/DataTableAbstract.php @@ -737,6 +737,8 @@ protected function filterRecords(): void public function filtering(): void { $keyword = $this->request->keyword(); + /**Following line of code to convert & or any other special character to html string. **/ + $keyword = (is_string($keyword) || $keyword instanceof Htmlable) ? e($keyword) : $keyword; if ($this->config->isMultiTerm()) { $this->smartGlobalSearch($keyword); From 7d6da25270a822d4c6b722f7835a751f78d277c6 Mon Sep 17 00:00:00 2001 From: sujon Date: Mon, 5 Dec 2022 22:28:55 +0600 Subject: [PATCH 2/2] Directly converted the keyword. --- src/DataTableAbstract.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DataTableAbstract.php b/src/DataTableAbstract.php index 8db6833b..0927567c 100644 --- a/src/DataTableAbstract.php +++ b/src/DataTableAbstract.php @@ -737,8 +737,8 @@ protected function filterRecords(): void public function filtering(): void { $keyword = $this->request->keyword(); - /**Following line of code to convert & or any other special character to html string. **/ - $keyword = (is_string($keyword) || $keyword instanceof Htmlable) ? e($keyword) : $keyword; + /**Following line of code to convert `&` or any other special character to html string. **/ + $keyword = e($keyword); if ($this->config->isMultiTerm()) { $this->smartGlobalSearch($keyword);