mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Prevent queries from unrelated tables
This commit is contained in:
parent
69834c9362
commit
6afcb90ba4
@ -255,7 +255,7 @@ abstract class QueryFilters
|
||||
|
||||
public function client_id(string $client_id = ''): Builder
|
||||
{
|
||||
if (strlen($client_id) == 0) {
|
||||
if (strlen($client_id) == 0 || !in_array('vendor_id', \Illuminate\Support\Facades\Schema::getColumnListing($this->builder->getModel()->getTable()))) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
@ -264,7 +264,7 @@ abstract class QueryFilters
|
||||
|
||||
public function vendor_id(string $vendor_id = ''): Builder
|
||||
{
|
||||
if (strlen($vendor_id) == 0) {
|
||||
if (strlen($vendor_id) == 0 || !in_array('vendor_id', \Illuminate\Support\Facades\Schema::getColumnListing($this->builder->getModel()->getTable()))) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user