aboutsummaryrefslogtreecommitdiffhomepage
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/bookmark/LinkUtils.php11
-rw-r--r--application/formatter/BookmarkDefaultFormatter.php7
-rw-r--r--application/front/controller/admin/ShaareManageController.php4
3 files changed, 16 insertions, 6 deletions
diff --git a/application/bookmark/LinkUtils.php b/application/bookmark/LinkUtils.php
index faf5dbfd..17c37979 100644
--- a/application/bookmark/LinkUtils.php
+++ b/application/bookmark/LinkUtils.php
@@ -138,12 +138,17 @@ function space2nbsp($text)
138 * 138 *
139 * @param string $description shaare's description. 139 * @param string $description shaare's description.
140 * @param string $indexUrl URL to Shaarli's index. 140 * @param string $indexUrl URL to Shaarli's index.
141 141 * @param bool $autolink Turn on/off automatic linkifications of URLs and hashtags
142 *
142 * @return string formatted description. 143 * @return string formatted description.
143 */ 144 */
144function format_description($description, $indexUrl = '') 145function format_description($description, $indexUrl = '', $autolink = true)
145{ 146{
146 return nl2br(space2nbsp(hashtag_autolink(text2clickable($description), $indexUrl))); 147 if ($autolink) {
148 $description = hashtag_autolink(text2clickable($description), $indexUrl);
149 }
150
151 return nl2br(space2nbsp($description));
147} 152}
148 153
149/** 154/**
diff --git a/application/formatter/BookmarkDefaultFormatter.php b/application/formatter/BookmarkDefaultFormatter.php
index d58a5e39..149a3eb9 100644
--- a/application/formatter/BookmarkDefaultFormatter.php
+++ b/application/formatter/BookmarkDefaultFormatter.php
@@ -46,8 +46,13 @@ class BookmarkDefaultFormatter extends BookmarkFormatter
46 $bookmark->getDescription() ?? '', 46 $bookmark->getDescription() ?? '',
47 $bookmark->getAdditionalContentEntry('search_highlight')['description'] ?? [] 47 $bookmark->getAdditionalContentEntry('search_highlight')['description'] ?? []
48 ); 48 );
49 $description = format_description(
50 escape($description),
51 $indexUrl,
52 $this->conf->get('formatter_settings.autolink', true)
53 );
49 54
50 return $this->replaceTokens(format_description(escape($description), $indexUrl)); 55 return $this->replaceTokens($description);
51 } 56 }
52 57
53 /** 58 /**
diff --git a/application/front/controller/admin/ShaareManageController.php b/application/front/controller/admin/ShaareManageController.php
index 7ceb8d8a..2ed298f5 100644
--- a/application/front/controller/admin/ShaareManageController.php
+++ b/application/front/controller/admin/ShaareManageController.php
@@ -66,8 +66,8 @@ class ShaareManageController extends ShaarliAdminController
66 return $response->write('<script>self.close();</script>'); 66 return $response->write('<script>self.close();</script>');
67 } 67 }
68 68
69 // Don't redirect to where we were previously because the datastore has changed. 69 // Don't redirect to permalink after deletion.
70 return $this->redirect($response, '/'); 70 return $this->redirectFromReferer($request, $response, ['shaare/']);
71 } 71 }
72 72
73 /** 73 /**