diff options
Diffstat (limited to 'application/api/controllers')
-rw-r--r-- | application/api/controllers/ApiController.php | 3 | ||||
-rw-r--r-- | application/api/controllers/Links.php | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/application/api/controllers/ApiController.php b/application/api/controllers/ApiController.php index c4b3d0c3..88a845eb 100644 --- a/application/api/controllers/ApiController.php +++ b/application/api/controllers/ApiController.php | |||
@@ -4,6 +4,7 @@ namespace Shaarli\Api\Controllers; | |||
4 | 4 | ||
5 | use Shaarli\Bookmark\BookmarkServiceInterface; | 5 | use Shaarli\Bookmark\BookmarkServiceInterface; |
6 | use Shaarli\Config\ConfigManager; | 6 | use Shaarli\Config\ConfigManager; |
7 | use Shaarli\History; | ||
7 | use Slim\Container; | 8 | use Slim\Container; |
8 | 9 | ||
9 | /** | 10 | /** |
@@ -31,7 +32,7 @@ abstract class ApiController | |||
31 | protected $bookmarkService; | 32 | protected $bookmarkService; |
32 | 33 | ||
33 | /** | 34 | /** |
34 | * @var HistoryController | 35 | * @var History |
35 | */ | 36 | */ |
36 | protected $history; | 37 | protected $history; |
37 | 38 | ||
diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php index 29247950..778097fd 100644 --- a/application/api/controllers/Links.php +++ b/application/api/controllers/Links.php | |||
@@ -116,7 +116,7 @@ class Links extends ApiController | |||
116 | public function postLink($request, $response) | 116 | public function postLink($request, $response) |
117 | { | 117 | { |
118 | $data = $request->getParsedBody(); | 118 | $data = $request->getParsedBody(); |
119 | $bookmark = ApiUtils::buildLinkFromRequest($data, $this->conf->get('privacy.default_private_links')); | 119 | $bookmark = ApiUtils::buildBookmarkFromRequest($data, $this->conf->get('privacy.default_private_links')); |
120 | // duplicate by URL, return 409 Conflict | 120 | // duplicate by URL, return 409 Conflict |
121 | if (! empty($bookmark->getUrl()) | 121 | if (! empty($bookmark->getUrl()) |
122 | && ! empty($dup = $this->bookmarkService->findByUrl($bookmark->getUrl())) | 122 | && ! empty($dup = $this->bookmarkService->findByUrl($bookmark->getUrl())) |
@@ -155,7 +155,7 @@ class Links extends ApiController | |||
155 | $index = index_url($this->ci['environment']); | 155 | $index = index_url($this->ci['environment']); |
156 | $data = $request->getParsedBody(); | 156 | $data = $request->getParsedBody(); |
157 | 157 | ||
158 | $requestBookmark = ApiUtils::buildLinkFromRequest($data, $this->conf->get('privacy.default_private_links')); | 158 | $requestBookmark = ApiUtils::buildBookmarkFromRequest($data, $this->conf->get('privacy.default_private_links')); |
159 | // duplicate URL on a different link, return 409 Conflict | 159 | // duplicate URL on a different link, return 409 Conflict |
160 | if (! empty($requestBookmark->getUrl()) | 160 | if (! empty($requestBookmark->getUrl()) |
161 | && ! empty($dup = $this->bookmarkService->findByUrl($requestBookmark->getUrl())) | 161 | && ! empty($dup = $this->bookmarkService->findByUrl($requestBookmark->getUrl())) |