From 0754f2f6e6bc7714887c0e88098952bedeea6a2f Mon Sep 17 00:00:00 2001 From: objecttothis Date: Fri, 1 Dec 2023 17:54:56 +0400 Subject: [PATCH] Fix Request variable retrieval - getSearch functions to properly retrieve HTTP vars. - getVar() function calls replaced with getGet() or getPost() - replaced TRUE/FALSE constants with true/false keywords --- app/Controllers/Attributes.php | 12 +++++------ app/Controllers/Cashups.php | 16 +++++++------- app/Controllers/Customers.php | 2 +- app/Controllers/Employees.php | 14 ++++++------- app/Controllers/Expenses.php | 28 ++++++++++++------------- app/Controllers/Expenses_categories.php | 10 ++++----- app/Controllers/Giftcards.php | 12 +++++------ app/Controllers/Item_kits.php | 10 ++++----- app/Controllers/Receivings.php | 8 +++---- app/Controllers/Sales.php | 18 ++++++++-------- app/Controllers/Secure_Controller.php | 2 +- app/Controllers/Suppliers.php | 4 ++-- app/Controllers/Tax_categories.php | 12 +++++------ app/Controllers/Tax_codes.php | 12 +++++------ app/Controllers/Tax_jurisdictions.php | 10 ++++----- app/Controllers/Taxes.php | 10 ++++----- 16 files changed, 90 insertions(+), 90 deletions(-) diff --git a/app/Controllers/Attributes.php b/app/Controllers/Attributes.php index 2ea49f1ef..d122f5088 100644 --- a/app/Controllers/Attributes.php +++ b/app/Controllers/Attributes.php @@ -37,11 +37,11 @@ class Attributes extends Secure_Controller */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $attributes = $this->attribute->search($search, $limit, $offset, $sort, $order); $total_rows = $this->attribute->get_found_rows($search); @@ -168,7 +168,7 @@ class Attributes extends Secure_Controller */ public function getSuggestAttribute(int $definition_id): void { - $suggestions = $this->attribute->get_suggestions($definition_id, html_entity_decode($this->request->getVar('term'))); + $suggestions = $this->attribute->get_suggestions($definition_id, html_entity_decode($this->request->getGet('term'))); echo json_encode($suggestions); } diff --git a/app/Controllers/Cashups.php b/app/Controllers/Cashups.php index bb276866d..8d68407bd 100644 --- a/app/Controllers/Cashups.php +++ b/app/Controllers/Cashups.php @@ -37,19 +37,19 @@ class Cashups extends Secure_Controller public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $filters = [ - 'start_date' => $this->request->getVar('start_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), //TODO: Is this the best way to filter dates - 'end_date' => $this->request->getVar('end_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), + 'start_date' => $this->request->getGet('start_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), //TODO: Is this the best way to filter dates + 'end_date' => $this->request->getGet('end_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), 'is_deleted' => FALSE ]; // check if any filter is set in the multiselect dropdown - $filledup = array_fill_keys($this->request->getVar('filters', FILTER_SANITIZE_FULL_SPECIAL_CHARS), TRUE); //TODO: $filledup doesn't follow variable naming patterns we are using. + $filledup = array_fill_keys($this->request->getGet('filters', FILTER_SANITIZE_FULL_SPECIAL_CHARS), TRUE); //TODO: $filledup doesn't follow variable naming patterns we are using. $filters = array_merge($filters, $filledup); $cash_ups = $this->cashup->search($search, $filters, $limit, $offset, $sort, $order); $total_rows = $this->cashup->get_found_rows($search, $filters); diff --git a/app/Controllers/Customers.php b/app/Controllers/Customers.php index 15688b9ba..9fb326e51 100644 --- a/app/Controllers/Customers.php +++ b/app/Controllers/Customers.php @@ -124,7 +124,7 @@ class Customers extends Persons */ public function getSuggest(): void { - $suggestions = $this->customer->get_search_suggestions($this->request->getVar('term'), 25,TRUE); + $suggestions = $this->customer->get_search_suggestions($this->request->getGet('term'), 25,TRUE); echo json_encode($suggestions); } diff --git a/app/Controllers/Employees.php b/app/Controllers/Employees.php index 999a352f1..195cd433e 100644 --- a/app/Controllers/Employees.php +++ b/app/Controllers/Employees.php @@ -24,11 +24,11 @@ class Employees extends Persons */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $employees = $this->employee->search($search, $limit, $offset, $sort, $order); $total_rows = $this->employee->get_found_rows($search); @@ -47,14 +47,14 @@ class Employees extends Persons */ public function suggest(): void { - $suggestions = $this->employee->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), 25, TRUE); + $suggestions = $this->employee->get_search_suggestions($this->request->getGet('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), 25, true); echo json_encode($suggestions); } public function suggest_search(): void { - $suggestions = $this->employee->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS)); + $suggestions = $this->employee->get_search_suggestions($this->request->getPost('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS)); echo json_encode($suggestions); } diff --git a/app/Controllers/Expenses.php b/app/Controllers/Expenses.php index 4235ff324..30e7bfceb 100644 --- a/app/Controllers/Expenses.php +++ b/app/Controllers/Expenses.php @@ -38,24 +38,24 @@ class Expenses extends Secure_Controller public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $filters = [ - 'start_date' => $this->request->getVar('start_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), - 'end_date' => $this->request->getVar('end_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), - 'only_cash' => FALSE, - 'only_due' => FALSE, - 'only_check' => FALSE, - 'only_credit' => FALSE, - 'only_debit' => FALSE, - 'is_deleted' => FALSE + 'start_date' => $this->request->getGet('start_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), + 'end_date' => $this->request->getGet('end_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), + 'only_cash' => false, + 'only_due' => false, + 'only_check' => false, + 'only_credit' => false, + 'only_debit' => false, + 'is_deleted' => false ]; // check if any filter is set in the multiselect dropdown - $filledup = array_fill_keys($this->request->getVar('filters', FILTER_SANITIZE_FULL_SPECIAL_CHARS), TRUE); //TODO: variable naming does not match standard + $filledup = array_fill_keys($this->request->getGet('filters', FILTER_SANITIZE_FULL_SPECIAL_CHARS), TRUE); //TODO: variable naming does not match standard $filters = array_merge($filters, $filledup); $expenses = $this->expense->search($search, $filters, $limit, $offset, $sort, $order); $total_rows = $this->expense->get_found_rows($search, $filters); diff --git a/app/Controllers/Expenses_categories.php b/app/Controllers/Expenses_categories.php index 2db5435b6..3b65a8838 100644 --- a/app/Controllers/Expenses_categories.php +++ b/app/Controllers/Expenses_categories.php @@ -27,11 +27,11 @@ class Expenses_categories extends Secure_Controller //TODO: Is this class ever u **/ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $expense_categories = $this->expense_category->search($search, $limit, $offset, $sort, $order); $total_rows = $this->expense_category->get_found_rows($search); diff --git a/app/Controllers/Giftcards.php b/app/Controllers/Giftcards.php index 6d3b94df1..dc60dcfd3 100644 --- a/app/Controllers/Giftcards.php +++ b/app/Controllers/Giftcards.php @@ -28,11 +28,11 @@ class Giftcards extends Secure_Controller */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $giftcards = $this->giftcard->search($search, $limit, $offset, $sort, $order); $total_rows = $this->giftcard->get_found_rows($search); @@ -52,7 +52,7 @@ class Giftcards extends Secure_Controller public function getSuggest(): void { - $suggestions = $this->giftcard->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), TRUE); + $suggestions = $this->giftcard->get_search_suggestions($this->request->getGet('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), true); echo json_encode($suggestions); } diff --git a/app/Controllers/Item_kits.php b/app/Controllers/Item_kits.php index 635662dc4..b08c8c06d 100644 --- a/app/Controllers/Item_kits.php +++ b/app/Controllers/Item_kits.php @@ -73,11 +73,11 @@ class Item_kits extends Secure_Controller */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? ''; - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS) ?? ''; + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $item_kits = $this->item_kit->search($search, $limit, $offset, $sort, $order); $total_rows = $this->item_kit->get_found_rows($search); diff --git a/app/Controllers/Receivings.php b/app/Controllers/Receivings.php index 0ef28a5a8..634b73b27 100644 --- a/app/Controllers/Receivings.php +++ b/app/Controllers/Receivings.php @@ -55,8 +55,8 @@ class Receivings extends Secure_Controller */ public function getItemSearch(): void { - $suggestions = $this->item->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), ['search_custom' => FALSE, 'is_deleted' => FALSE], TRUE); - $suggestions = array_merge($suggestions, $this->item_kit->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS))); + $suggestions = $this->item->get_search_suggestions($this->request->getGet('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), ['search_custom' => false, 'is_deleted' => false], true); + $suggestions = array_merge($suggestions, $this->item_kit->get_search_suggestions($this->request->getGet('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS))); echo json_encode($suggestions); } @@ -67,8 +67,8 @@ class Receivings extends Secure_Controller */ public function getStockItemSearch(): void { - $suggestions = $this->item->get_stock_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), ['search_custom' => FALSE, 'is_deleted' => FALSE], TRUE); - $suggestions = array_merge($suggestions, $this->item_kit->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS))); + $suggestions = $this->item->get_stock_search_suggestions($this->request->getGet('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), ['search_custom' => false, 'is_deleted' => false], true); + $suggestions = array_merge($suggestions, $this->item_kit->get_search_suggestions($this->request->getGet('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS))); echo json_encode($suggestions); } diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index 82cbc03d5..c3f1e7f48 100644 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -103,27 +103,27 @@ class Sales extends Secure_Controller public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $filters = [ 'sale_type' => 'all', 'location_id' => 'all', - 'start_date' => $this->request->getVar('start_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), - 'end_date' => $this->request->getVar('end_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), + 'start_date' => $this->request->getGet('start_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), + 'end_date' => $this->request->getGet('end_date', FILTER_SANITIZE_FULL_SPECIAL_CHARS), 'only_cash' => FALSE, 'only_due' => FALSE, 'only_check' => FALSE, 'only_creditcard' => FALSE, - 'only_invoices' => $this->config['invoice_enable'] && $this->request->getVar('only_invoices', FILTER_SANITIZE_NUMBER_INT), + 'only_invoices' => $this->config['invoice_enable'] && $this->request->getGet('only_invoices', FILTER_SANITIZE_NUMBER_INT), 'is_valid_receipt' => $this->sale->is_valid_receipt($search) ]; // check if any filter is set in the multiselect dropdown - $filledup = array_fill_keys($this->request->getVar('filters', FILTER_SANITIZE_FULL_SPECIAL_CHARS), TRUE); //TODO: Variable does not meet naming conventions + $filledup = array_fill_keys($this->request->getGet('filters', FILTER_SANITIZE_FULL_SPECIAL_CHARS), true); //TODO: Variable does not meet naming conventions $filters = array_merge($filters, $filledup); $sales = $this->sale->search($search, $filters, $limit, $offset, $sort, $order); diff --git a/app/Controllers/Secure_Controller.php b/app/Controllers/Secure_Controller.php index c238b2df7..3bcee2849 100644 --- a/app/Controllers/Secure_Controller.php +++ b/app/Controllers/Secure_Controller.php @@ -83,7 +83,7 @@ class Secure_Controller extends BaseController { $result = true; - foreach($this->request->getVar(null, FILTER_SANITIZE_FULL_SPECIAL_CHARS) as $value) + foreach($this->request->getGet(null, FILTER_SANITIZE_FULL_SPECIAL_CHARS) as $value) { $result &= (int)parse_decimals($value); } diff --git a/app/Controllers/Suppliers.php b/app/Controllers/Suppliers.php index 12828e2bc..d0a2a614b 100644 --- a/app/Controllers/Suppliers.php +++ b/app/Controllers/Suppliers.php @@ -68,14 +68,14 @@ class Suppliers extends Persons */ public function suggest(): void { - $suggestions = $this->supplier->get_search_suggestions($this->request->getVar('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), TRUE); + $suggestions = $this->supplier->get_search_suggestions($this->request->getGet('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), true); echo json_encode($suggestions); } public function suggest_search() { - $suggestions = $this->supplier->get_search_suggestions($this->request->getPost('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), FALSE); + $suggestions = $this->supplier->get_search_suggestions($this->request->getPost('term', FILTER_SANITIZE_FULL_SPECIAL_CHARS), false); echo json_encode($suggestions); } diff --git a/app/Controllers/Tax_categories.php b/app/Controllers/Tax_categories.php index 7419683ea..8dfa8c71f 100644 --- a/app/Controllers/Tax_categories.php +++ b/app/Controllers/Tax_categories.php @@ -12,7 +12,7 @@ class Tax_categories extends Secure_Controller public function __construct() { parent::__construct('tax_categories'); - + $this->tax_category = model('Tax_category'); } @@ -28,11 +28,11 @@ class Tax_categories extends Secure_Controller */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $tax_categories = $this->tax_category->search($search, $limit, $offset, $sort, $order); $total_rows = $this->tax_category->get_found_rows($search); diff --git a/app/Controllers/Tax_codes.php b/app/Controllers/Tax_codes.php index 6123905f9..6d88a46b3 100644 --- a/app/Controllers/Tax_codes.php +++ b/app/Controllers/Tax_codes.php @@ -12,7 +12,7 @@ class Tax_codes extends Secure_Controller public function __construct() { parent::__construct('tax_codes'); - + $this->tax_code = model('Tax_code'); helper('tax_helper'); } @@ -35,11 +35,11 @@ class Tax_codes extends Secure_Controller */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $tax_codes = $this->tax_code->search($search, $limit, $offset, $sort, $order); $total_rows = $this->tax_code->get_found_rows($search); diff --git a/app/Controllers/Tax_jurisdictions.php b/app/Controllers/Tax_jurisdictions.php index 455a0b5cf..a9c4d156e 100644 --- a/app/Controllers/Tax_jurisdictions.php +++ b/app/Controllers/Tax_jurisdictions.php @@ -31,11 +31,11 @@ class Tax_jurisdictions extends Secure_Controller */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $tax_jurisdictions = $this->tax_jurisdiction->search($search, $limit, $offset, $sort, $order); $total_rows = $this->tax_jurisdiction->get_found_rows($search); diff --git a/app/Controllers/Taxes.php b/app/Controllers/Taxes.php index 9f98e098a..e0981ceeb 100644 --- a/app/Controllers/Taxes.php +++ b/app/Controllers/Taxes.php @@ -78,11 +78,11 @@ class Taxes extends Secure_Controller */ public function getSearch(): void { - $search = $this->request->getVar('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $limit = $this->request->getVar('limit', FILTER_SANITIZE_NUMBER_INT); - $offset = $this->request->getVar('offset', FILTER_SANITIZE_NUMBER_INT); - $sort = $this->request->getVar('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); - $order = $this->request->getVar('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $search = $this->request->getGet('search', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $limit = $this->request->getGet('limit', FILTER_SANITIZE_NUMBER_INT); + $offset = $this->request->getGet('offset', FILTER_SANITIZE_NUMBER_INT); + $sort = $this->request->getGet('sort', FILTER_SANITIZE_FULL_SPECIAL_CHARS); + $order = $this->request->getGet('order', FILTER_SANITIZE_FULL_SPECIAL_CHARS); $tax_rates = $this->tax->search($search, $limit, $offset, $sort, $order);