diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-07-28 21:09:22 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-28 21:09:22 +0200 |
commit | 624123177f8673f978c49186b43fd96c6827d8a0 (patch) | |
tree | 75e2ed0dc673bf8dc1bd694a112a97364756e4f9 | |
parent | 301c7ab1a079d937ab41c6f52b8804e5731008e6 (diff) | |
download | Shaarli-624123177f8673f978c49186b43fd96c6827d8a0.tar.gz Shaarli-624123177f8673f978c49186b43fd96c6827d8a0.tar.zst Shaarli-624123177f8673f978c49186b43fd96c6827d8a0.zip |
Include empty basePath in formatting
-rw-r--r-- | application/formatter/BookmarkDefaultFormatter.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/application/formatter/BookmarkDefaultFormatter.php b/application/formatter/BookmarkDefaultFormatter.php index 08e710eb..9d4a0fa0 100644 --- a/application/formatter/BookmarkDefaultFormatter.php +++ b/application/formatter/BookmarkDefaultFormatter.php | |||
@@ -50,7 +50,7 @@ class BookmarkDefaultFormatter extends BookmarkFormatter | |||
50 | */ | 50 | */ |
51 | public function formatUrl($bookmark) | 51 | public function formatUrl($bookmark) |
52 | { | 52 | { |
53 | if ($bookmark->isNote() && !empty($this->contextData['index_url'])) { | 53 | if ($bookmark->isNote() && isset($this->contextData['index_url'])) { |
54 | return rtrim($this->contextData['index_url'], '/') . '/' . escape(ltrim($bookmark->getUrl(), '/')); | 54 | return rtrim($this->contextData['index_url'], '/') . '/' . escape(ltrim($bookmark->getUrl(), '/')); |
55 | } | 55 | } |
56 | 56 | ||
@@ -63,11 +63,11 @@ class BookmarkDefaultFormatter extends BookmarkFormatter | |||
63 | protected function formatRealUrl($bookmark) | 63 | protected function formatRealUrl($bookmark) |
64 | { | 64 | { |
65 | if ($bookmark->isNote()) { | 65 | if ($bookmark->isNote()) { |
66 | if (!empty($this->contextData['index_url'])) { | 66 | if (isset($this->contextData['index_url'])) { |
67 | $prefix = rtrim($this->contextData['index_url'], '/') . '/'; | 67 | $prefix = rtrim($this->contextData['index_url'], '/') . '/'; |
68 | } | 68 | } |
69 | 69 | ||
70 | if (!empty($this->contextData['base_path'])) { | 70 | if (isset($this->contextData['base_path'])) { |
71 | $prefix = rtrim($this->contextData['base_path'], '/') . '/'; | 71 | $prefix = rtrim($this->contextData['base_path'], '/') . '/'; |
72 | } | 72 | } |
73 | 73 | ||