diff options
Diffstat (limited to 'application/api/controllers/Links.php')
-rw-r--r-- | application/api/controllers/Links.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php index 3a9c0355..ffcfd4c7 100644 --- a/application/api/controllers/Links.php +++ b/application/api/controllers/Links.php | |||
@@ -68,16 +68,16 @@ class Links extends ApiController | |||
68 | } | 68 | } |
69 | 69 | ||
70 | // 'environment' is set by Slim and encapsulate $_SERVER. | 70 | // 'environment' is set by Slim and encapsulate $_SERVER. |
71 | $index = index_url($this->ci['environment']); | 71 | $indexUrl = index_url($this->ci['environment']); |
72 | 72 | ||
73 | $out = []; | 73 | $out = []; |
74 | $cpt = 0; | 74 | $index = 0; |
75 | foreach ($links as $link) { | 75 | foreach ($links as $link) { |
76 | if (count($out) >= $limit) { | 76 | if (count($out) >= $limit) { |
77 | break; | 77 | break; |
78 | } | 78 | } |
79 | if ($cpt++ >= $offset) { | 79 | if ($index++ >= $offset) { |
80 | $out[] = ApiUtils::formatLink($link, $index); | 80 | $out[] = ApiUtils::formatLink($link, $indexUrl); |
81 | } | 81 | } |
82 | } | 82 | } |
83 | 83 | ||