$bookmark->setDescription($request->getParam('lf_description'));
$bookmark->setUrl($request->getParam('lf_url'), $this->container->conf->get('security.allowed_protocols', []));
$bookmark->setPrivate(filter_var($request->getParam('lf_private'), FILTER_VALIDATE_BOOLEAN));
- $bookmark->setTagsString($request->getParam('lf_tags'));
+ $bookmark->setTagsString(
+ $request->getParam('lf_tags'),
+ $this->container->conf->get('general.tags_separator', ' ')
+ );
- if ($this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
+ if (
+ $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
&& true !== $this->container->conf->get('general.enable_async_metadata', true)
&& $bookmark->shouldUpdateThumbnail()
) {
$data = $formatter->format($bookmark);
$this->executePageHooks('save_link', $data);
- $bookmark->fromArray($data);
+ $bookmark->fromArray($data, $this->container->conf->get('general.tags_separator', ' '));
$this->container->bookmarkService->set($bookmark);
// If we are called from the bookmarklet, we must close the popup:
return $this->redirectFromReferer(
$request,
$response,
- ['/admin/add-shaare', '/admin/shaare'], ['addlink', 'post', 'edit_link'],
+ ['/admin/add-shaare', '/admin/shaare'],
+ ['addlink', 'post', 'edit_link'],
$bookmark->getShortUrl()
);
}
$this->assignView($key, $value);
}
- $editLabel = false === $isNew ? t('Edit') .' ' : '';
+ $editLabel = false === $isNew ? t('Edit') . ' ' : '';
$this->assignView(
'pagetitle',
- $editLabel . t('Shaare') .' - '. $this->container->conf->get('general.title', 'Shaarli')
+ $editLabel . t('Shaare') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
);
return $response->write($this->render(TemplatePage::EDIT_LINK));
// If this is an HTTP(S) link, we try go get the page to extract
// the title (otherwise we will to straight to the edit form.)
- if (true !== $this->container->conf->get('general.enable_async_metadata', true)
+ if (
+ true !== $this->container->conf->get('general.enable_async_metadata', true)
&& empty($title)
&& strpos(get_url_scheme($url) ?: '', 'http') !== false
) {
protected function buildFormData(array $link, bool $isNew, Request $request): array
{
+ $link['tags'] = strlen($link['tags']) > 0
+ ? $link['tags'] . $this->container->conf->get('general.tags_separator', ' ')
+ : $link['tags']
+ ;
+
return escape([
'link' => $link,
'link_is_new' => $isNew,