Skip to content

Commit 79d300d

Browse files
author
Marco Cesarato
committed
Fixed some warnings
1 parent a9122c0 commit 79d300d

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PHP Database Web API
22
![](cover.png)
33

4-
**Version:** 0.6.123 beta
4+
**Version:** 0.6.124 beta
55

66
**Github:** https://github.com/marcocesarato/Database-Web-API
77

includes/classes/API.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ private function get($query, $db = null) {
624624
$join_sql .= "{$join_value_table}.{$join_value_column}";
625625
}
626626
}
627-
if($query['prefix'] && count($select_tables) > 1) {
627+
if(!empty($query['prefix']) && count($select_tables) > 1) {
628628
$prefix_columns = array();
629629
foreach($select_tables as $table) {
630630
$columns = $this->getColumns($table, $db);
@@ -639,7 +639,7 @@ private function get($query, $db = null) {
639639
}
640640

641641
// Prefix table before column
642-
if($query['prefix']) {
642+
if(!empty($query['prefix'])) {
643643
$prefix_columns = array();
644644
foreach($select_tables as $table) {
645645
$columns = $this->getColumns($table, $db);
@@ -665,7 +665,7 @@ private function get($query, $db = null) {
665665
}
666666

667667
// build ORDER query
668-
if(isset($query['order_by']) && !empty($query['order_by'])) {
668+
if(!empty($query['order_by'])) {
669669

670670
$order_by = $query['order_by'];
671671
if(!is_array($order_by)) {
@@ -764,7 +764,7 @@ private function get($query, $db = null) {
764764
}
765765

766766
// build LIMIT query
767-
if(is_numeric($query['limit'])) {
767+
if(!empty($query['limit']) && is_numeric($query['limit'])) {
768768
$sql .= " LIMIT " . (int) $query['limit'];
769769
}
770770

@@ -801,7 +801,7 @@ private function get($query, $db = null) {
801801
// Sanitize encoding
802802
$results = $this->sanitizeResults($results);
803803

804-
if($query['unique']) {
804+
if(!empty($query['unique'])) {
805805
$results = array_unique($results, SORT_REGULAR);
806806
$results = array_filter($results);
807807
}
@@ -1164,6 +1164,7 @@ private function executeInsert($table, $columns, $dbh) {
11641164
* @param $data
11651165
*/
11661166
public function render($data) {
1167+
ob_clean();
11671168
$default_format = Request::method() == 'GET' ? "html" : "json";
11681169
$data = $this->hooks->apply_filters('render', $data, $this->query, Request::method());
11691170
$renderer = 'render' . ucfirst(strtolower(isset($this->query['format']) ? $this->query['format'] : $default_format));

0 commit comments

Comments
 (0)