aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/api_zot.php8
-rw-r--r--include/attach.php2
2 files changed, 8 insertions, 2 deletions
diff --git a/include/api_zot.php b/include/api_zot.php
index 35025f5f8..bdbed6a5f 100644
--- a/include/api_zot.php
+++ b/include/api_zot.php
@@ -124,7 +124,13 @@
$start = ((array_key_exists('start',$_REQUEST)) ? intval($_REQUEST['start']) : 0);
$records = ((array_key_exists('records',$_REQUEST)) ? intval($_REQUEST['records']) : 0);
- json_return_and_die(attach_list_files(api_user(),get_observer_hash(),$hash,$filename,$filetype,'created asc',$start,$records));
+ $x = attach_list_files(api_user(),get_observer_hash(),$hash,$filename,$filetype,'created asc',$start,$records);
+ if($start || $records) {
+ $x['start'] = $start;
+ $x['records'] = count($x['results']);
+ }
+
+ json_return_and_die($x);
}
diff --git a/include/attach.php b/include/attach.php
index 504601b55..ba2f60a90 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -203,7 +203,7 @@ function attach_list_files($channel_id, $observer, $hash = '', $filename = '', $
$sql_extra .= protect_sprintf(" and filetype like '%" . dbesc($filetype) . "%' ");
if($entries)
- $limit = " limit " . intval($start) . ", " . intval(entries) . " ";
+ $limit = " limit " . intval($start) . ", " . intval($entries) . " ";
// Retrieve all columns except 'data'