]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - application/api/controllers/Links.php
Implements Tags endpoints for Shaarli's REST API
[github/shaarli/Shaarli.git] / application / api / controllers / Links.php
index 3a9c03553a30fbe5247e48a2a6c30eb4f34e7b51..ffcfd4c75a4f8748101675247a138c083bd1dd27 100644 (file)
@@ -68,16 +68,16 @@ class Links extends ApiController
         }
 
         // 'environment' is set by Slim and encapsulate $_SERVER.
-        $index = index_url($this->ci['environment']);
+        $indexUrl = index_url($this->ci['environment']);
 
         $out = [];
-        $cpt = 0;
+        $index = 0;
         foreach ($links as $link) {
             if (count($out) >= $limit) {
                 break;
             }
-            if ($cpt++ >= $offset) {
-                $out[] = ApiUtils::formatLink($link, $index);
+            if ($index++ >= $offset) {
+                $out[] = ApiUtils::formatLink($link, $indexUrl);
             }
         }