diff options
author | ArthurHoaro <arthur@hoa.ro> | 2021-01-03 11:43:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-03 11:43:31 +0100 |
commit | 20ba77a2dc59d3a8d0cb1666267724bad864f62d (patch) | |
tree | 17002fc6a277d21f728f103434bd8a70561affa5 /application/api/controllers/Links.php | |
parent | fe58bdcd9e0ddca8a2a99142dc9eaee8845efa67 (diff) | |
parent | 0640c1a6db6d9a13e5d0079f0bf42497010edbc7 (diff) | |
download | Shaarli-20ba77a2dc59d3a8d0cb1666267724bad864f62d.tar.gz Shaarli-20ba77a2dc59d3a8d0cb1666267724bad864f62d.tar.zst Shaarli-20ba77a2dc59d3a8d0cb1666267724bad864f62d.zip |
Merge pull request #1672 from ArthurHoaro/feature/api-parse-tags-string
Diffstat (limited to 'application/api/controllers/Links.php')
-rw-r--r-- | application/api/controllers/Links.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php index c379b962..b83b2260 100644 --- a/application/api/controllers/Links.php +++ b/application/api/controllers/Links.php | |||
@@ -117,7 +117,11 @@ class Links extends ApiController | |||
117 | public function postLink($request, $response) | 117 | public function postLink($request, $response) |
118 | { | 118 | { |
119 | $data = (array) ($request->getParsedBody() ?? []); | 119 | $data = (array) ($request->getParsedBody() ?? []); |
120 | $bookmark = ApiUtils::buildBookmarkFromRequest($data, $this->conf->get('privacy.default_private_links')); | 120 | $bookmark = ApiUtils::buildBookmarkFromRequest( |
121 | $data, | ||
122 | $this->conf->get('privacy.default_private_links'), | ||
123 | $this->conf->get('general.tags_separator', ' ') | ||
124 | ); | ||
121 | // duplicate by URL, return 409 Conflict | 125 | // duplicate by URL, return 409 Conflict |
122 | if ( | 126 | if ( |
123 | ! empty($bookmark->getUrl()) | 127 | ! empty($bookmark->getUrl()) |
@@ -158,7 +162,11 @@ class Links extends ApiController | |||
158 | $index = index_url($this->ci['environment']); | 162 | $index = index_url($this->ci['environment']); |
159 | $data = $request->getParsedBody(); | 163 | $data = $request->getParsedBody(); |
160 | 164 | ||
161 | $requestBookmark = ApiUtils::buildBookmarkFromRequest($data, $this->conf->get('privacy.default_private_links')); | 165 | $requestBookmark = ApiUtils::buildBookmarkFromRequest( |
166 | $data, | ||
167 | $this->conf->get('privacy.default_private_links'), | ||
168 | $this->conf->get('general.tags_separator', ' ') | ||
169 | ); | ||
162 | // duplicate URL on a different link, return 409 Conflict | 170 | // duplicate URL on a different link, return 409 Conflict |
163 | if ( | 171 | if ( |
164 | ! empty($requestBookmark->getUrl()) | 172 | ! empty($requestBookmark->getUrl()) |