aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/formatter/BookmarkDefaultFormatter.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/formatter/BookmarkDefaultFormatter.php')
-rw-r--r--application/formatter/BookmarkDefaultFormatter.php22
1 files changed, 14 insertions, 8 deletions
diff --git a/application/formatter/BookmarkDefaultFormatter.php b/application/formatter/BookmarkDefaultFormatter.php
index c6c59064..08e710eb 100644
--- a/application/formatter/BookmarkDefaultFormatter.php
+++ b/application/formatter/BookmarkDefaultFormatter.php
@@ -50,11 +50,10 @@ class BookmarkDefaultFormatter extends BookmarkFormatter
50 */ 50 */
51 public function formatUrl($bookmark) 51 public function formatUrl($bookmark)
52 { 52 {
53 if (! empty($this->contextData['index_url']) && ( 53 if ($bookmark->isNote() && !empty($this->contextData['index_url'])) {
54 startsWith($bookmark->getUrl(), '?') || startsWith($bookmark->getUrl(), '/') 54 return rtrim($this->contextData['index_url'], '/') . '/' . escape(ltrim($bookmark->getUrl(), '/'));
55 )) {
56 return $this->contextData['index_url'] . escape($bookmark->getUrl());
57 } 55 }
56
58 return escape($bookmark->getUrl()); 57 return escape($bookmark->getUrl());
59 } 58 }
60 59
@@ -63,11 +62,18 @@ class BookmarkDefaultFormatter extends BookmarkFormatter
63 */ 62 */
64 protected function formatRealUrl($bookmark) 63 protected function formatRealUrl($bookmark)
65 { 64 {
66 if (! empty($this->contextData['index_url']) && ( 65 if ($bookmark->isNote()) {
67 startsWith($bookmark->getUrl(), '?') || startsWith($bookmark->getUrl(), '/') 66 if (!empty($this->contextData['index_url'])) {
68 )) { 67 $prefix = rtrim($this->contextData['index_url'], '/') . '/';
69 return $this->contextData['index_url'] . escape($bookmark->getUrl()); 68 }
69
70 if (!empty($this->contextData['base_path'])) {
71 $prefix = rtrim($this->contextData['base_path'], '/') . '/';
72 }
73
74 return escape($prefix ?? '') . escape(ltrim($bookmark->getUrl(), '/'));
70 } 75 }
76
71 return escape($bookmark->getUrl()); 77 return escape($bookmark->getUrl());
72 } 78 }
73 79