Include empty basePath in formatting

This commit is contained in:
ArthurHoaro 2020-07-28 21:09:22 +02:00
parent 301c7ab1a0
commit 624123177f

View file

@ -50,7 +50,7 @@ public function formatTagString($bookmark)
*/ */
public function formatUrl($bookmark) public function formatUrl($bookmark)
{ {
if ($bookmark->isNote() && !empty($this->contextData['index_url'])) { if ($bookmark->isNote() && isset($this->contextData['index_url'])) {
return rtrim($this->contextData['index_url'], '/') . '/' . escape(ltrim($bookmark->getUrl(), '/')); return rtrim($this->contextData['index_url'], '/') . '/' . escape(ltrim($bookmark->getUrl(), '/'));
} }
@ -63,11 +63,11 @@ public function formatUrl($bookmark)
protected function formatRealUrl($bookmark) protected function formatRealUrl($bookmark)
{ {
if ($bookmark->isNote()) { if ($bookmark->isNote()) {
if (!empty($this->contextData['index_url'])) { if (isset($this->contextData['index_url'])) {
$prefix = rtrim($this->contextData['index_url'], '/') . '/'; $prefix = rtrim($this->contextData['index_url'], '/') . '/';
} }
if (!empty($this->contextData['base_path'])) { if (isset($this->contextData['base_path'])) {
$prefix = rtrim($this->contextData['base_path'], '/') . '/'; $prefix = rtrim($this->contextData['base_path'], '/') . '/';
} }