Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ysurac committed Jul 20, 2017
1 parent cccbb00 commit 0408739
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions require/class.Spotter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1316,8 +1316,6 @@ public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '', $fil
{
global $global_query;

date_default_timezone_set('UTC');

$query_values = array();
$limit_query = '';
$additional_query = '';
Expand All @@ -1333,33 +1331,27 @@ public function getSpotterDataByIdent($ident = '', $limit = '', $sort = '', $fil
}
} else {
$additional_query = " spotter_output.ident <> ''";

}
if ($limit != "")
{
$limit_array = explode(",", $limit);

$limit_array[0] = filter_var($limit_array[0],FILTER_SANITIZE_NUMBER_INT);
$limit_array[1] = filter_var($limit_array[1],FILTER_SANITIZE_NUMBER_INT);

if ($limit_array[0] >= 0 && $limit_array[1] >= 0)
{
//$limit_query = " LIMIT ".$limit_array[0].",".$limit_array[1];
$limit_query = " LIMIT ".$limit_array[1]." OFFSET ".$limit_array[0];
}
}

if ($sort != "")
{
$search_orderby_array = $this->getOrderBy();
$orderby_query = $search_orderby_array[$sort]['sql'];
} else {
$orderby_query = " ORDER BY spotter_output.date DESC";
}

$query = $global_query.$filter_query.$additional_query." ".$orderby_query;

$spotter_array = $this->getDataFromDB($query, $query_values, $limit_query);

return $spotter_array;
}

Expand All @@ -1385,7 +1377,7 @@ public function getSpotterDataByOwner($owner = '', $limit = '', $sort = '', $fil
{
return false;
} else {
$additional_query = " AND (spotter_output.owner_name = :owner)";
$additional_query = " AND spotter_output.owner_name = :owner";
$query_values = array(':owner' => $owner);
}
}
Expand Down

0 comments on commit 0408739

Please sign in to comment.