diff options
Diffstat (limited to 'libraries/classes/Controllers/Table/TableSearchController.php')
-rw-r--r-- | libraries/classes/Controllers/Table/TableSearchController.php | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/libraries/classes/Controllers/Table/TableSearchController.php b/libraries/classes/Controllers/Table/TableSearchController.php index 2f6eae6767..a0ef7bd31d 100644 --- a/libraries/classes/Controllers/Table/TableSearchController.php +++ b/libraries/classes/Controllers/Table/TableSearchController.php @@ -13,7 +13,6 @@ use PhpMyAdmin\Controllers\TableController; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Relation; use PhpMyAdmin\Sql; -use PhpMyAdmin\Template; use PhpMyAdmin\Util; /** @@ -364,7 +363,7 @@ class TableSearchController extends TableController $row[$_POST['criteriaColumnNames'][1]], 'where_clause' => $uniqueCondition[0] ]; - $tmpData[$dataLabel] = ($dataLabel) ? $row[$dataLabel] : ''; + $tmpData[$dataLabel] = $dataLabel ? $row[$dataLabel] : ''; $data[] = $tmpData; } unset($tmpData); @@ -418,7 +417,7 @@ class TableSearchController extends TableController } $key = array_search($field, $this->_columnNames); $search_index - = ((isset($_REQUEST['it']) && is_numeric($_REQUEST['it'])) + = (isset($_REQUEST['it']) && is_numeric($_REQUEST['it']) ? intval($_REQUEST['it']) : 0); $properties = $this->getColumnProperties($search_index, $key); @@ -571,7 +570,7 @@ class TableSearchController extends TableController 'criteria_column_types' => isset($_POST['criteriaColumnTypes']) ? $_POST['criteriaColumnTypes'] : null, 'sql_types' => $this->dbi->types, 'max_rows' => intval($GLOBALS['cfg']['MaxRows']), - 'max_plot_limit' => ((! empty($_POST['maxPlotLimit'])) + 'max_plot_limit' => (! empty($_POST['maxPlotLimit']) ? intval($_POST['maxPlotLimit']) : intval($GLOBALS['cfg']['maxRowPlotLimit'])), ]) @@ -825,9 +824,7 @@ class TableSearchController extends TableController . 'FROM ' . Util::backquote($this->db) . '.' . Util::backquote($this->table); - $result = $this->dbi->fetchSingleRow($sql_query); - - return $result; + return $this->dbi->fetchSingleRow($sql_query); } /** @@ -869,7 +866,7 @@ class TableSearchController extends TableController $sql_query = 'SELECT '; // If only distinct values are needed - $is_distinct = (isset($_POST['distinct'])) ? 'true' : 'false'; + $is_distinct = isset($_POST['distinct']) ? 'true' : 'false'; if ($is_distinct == 'true') { $sql_query .= 'DISTINCT '; } @@ -1084,14 +1081,12 @@ class TableSearchController extends TableController // If the function takes multiple parameters if (strpos($func_type, "IS NULL") !== false || strpos($func_type, "IS NOT NULL") !== false) { - $where = Util::backquote($names) . " " . $func_type; - return $where; + return Util::backquote($names) . " " . $func_type; } elseif ($geom_funcs[$geom_func]['params'] > 1) { // create gis data from the criteria input $gis_data = Util::createGISData($criteriaValues); - $where = $geom_func . '(' . Util::backquote($names) + return $geom_func . '(' . Util::backquote($names) . ', ' . $gis_data . ')'; - return $where; } // New output type is the output type of the function being applied |