aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/front/controller/admin/ShaarePublishController.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-11-08 14:07:33 +0100
committerGitHub <noreply@github.com>2020-11-08 14:07:33 +0100
commitd9d71b10c3bc70a0881d630b37dc4e918c9e812f (patch)
treed8f772a9106fbd5072ebee1b9fa536babe90f7b1 /application/front/controller/admin/ShaarePublishController.php
parentc51d65238be43d61b7e6a6f9940948afea0c13fa (diff)
parent8a1ce1da15fdbae99b24700b06f2008c7a657603 (diff)
downloadShaarli-d9d71b10c3bc70a0881d630b37dc4e918c9e812f.tar.gz
Shaarli-d9d71b10c3bc70a0881d630b37dc4e918c9e812f.tar.zst
Shaarli-d9d71b10c3bc70a0881d630b37dc4e918c9e812f.zip
Merge pull request #1621 from ArthurHoaro/feature/tag-separators
Diffstat (limited to 'application/front/controller/admin/ShaarePublishController.php')
-rw-r--r--application/front/controller/admin/ShaarePublishController.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/application/front/controller/admin/ShaarePublishController.php b/application/front/controller/admin/ShaarePublishController.php
index 18afc2d1..625a5680 100644
--- a/application/front/controller/admin/ShaarePublishController.php
+++ b/application/front/controller/admin/ShaarePublishController.php
@@ -113,7 +113,10 @@ class ShaarePublishController extends ShaarliAdminController
113 $bookmark->setDescription($request->getParam('lf_description')); 113 $bookmark->setDescription($request->getParam('lf_description'));
114 $bookmark->setUrl($request->getParam('lf_url'), $this->container->conf->get('security.allowed_protocols', [])); 114 $bookmark->setUrl($request->getParam('lf_url'), $this->container->conf->get('security.allowed_protocols', []));
115 $bookmark->setPrivate(filter_var($request->getParam('lf_private'), FILTER_VALIDATE_BOOLEAN)); 115 $bookmark->setPrivate(filter_var($request->getParam('lf_private'), FILTER_VALIDATE_BOOLEAN));
116 $bookmark->setTagsString($request->getParam('lf_tags')); 116 $bookmark->setTagsString(
117 $request->getParam('lf_tags'),
118 $this->container->conf->get('general.tags_separator', ' ')
119 );
117 120
118 if ($this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE 121 if ($this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
119 && true !== $this->container->conf->get('general.enable_async_metadata', true) 122 && true !== $this->container->conf->get('general.enable_async_metadata', true)
@@ -128,7 +131,7 @@ class ShaarePublishController extends ShaarliAdminController
128 $data = $formatter->format($bookmark); 131 $data = $formatter->format($bookmark);
129 $this->executePageHooks('save_link', $data); 132 $this->executePageHooks('save_link', $data);
130 133
131 $bookmark->fromArray($data); 134 $bookmark->fromArray($data, $this->container->conf->get('general.tags_separator', ' '));
132 $this->container->bookmarkService->set($bookmark); 135 $this->container->bookmarkService->set($bookmark);
133 136
134 // If we are called from the bookmarklet, we must close the popup: 137 // If we are called from the bookmarklet, we must close the popup:
@@ -221,6 +224,11 @@ class ShaarePublishController extends ShaarliAdminController
221 224
222 protected function buildFormData(array $link, bool $isNew, Request $request): array 225 protected function buildFormData(array $link, bool $isNew, Request $request): array
223 { 226 {
227 $link['tags'] = strlen($link['tags']) > 0
228 ? $link['tags'] . $this->container->conf->get('general.tags_separator', ' ')
229 : $link['tags']
230 ;
231
224 return escape([ 232 return escape([
225 'link' => $link, 233 'link' => $link,
226 'link_is_new' => $isNew, 234 'link_is_new' => $isNew,