diff --git a/action.php b/action.php index 1880b60..d909010 100644 --- a/action.php +++ b/action.php @@ -48,8 +48,10 @@ function actionrenderer(Doku_Event $event, $param) { $returnonly = $args[3] ?: false; $linktype = $args[4] ?: 'content'; + resolve_pageid(getNS($ID), $id, $exists); + global $ID; - if (!$this->m_helper->isExcluded($ID) && page_exists($id) && $id != $ID) { + if (!$this->m_helper->isExcluded($ID) && $exists && $id != $ID) { $event->preventDefault(); // If we call $renderer->internallink directly here, it will cause infinite recursion, diff --git a/helper.php b/helper.php index fadcfac..a85fc37 100644 --- a/helper.php +++ b/helper.php @@ -176,7 +176,6 @@ public function stripNativeTooltip($link) { */ static function read_meta_fast($id) { global $ID; - $id = resolve_id(getNS($ID), preg_replace('/\#.*$/', '', $id), true); if (isset(self::$metaCache[$id])) { return self::$metaCache[$id]; diff --git a/renderer.php b/renderer.php index d86b0f9..6cef982 100644 --- a/renderer.php +++ b/renderer.php @@ -44,9 +44,10 @@ function canRender($format) { function internallink($id, $name = null, $search = null, $returnonly = false, $linktype = 'content') { global $ID; $fullId = $id; - $id = preg_replace('/\#.*$/', '', $id); + $id = preg_replace('/(\#|\?).*$/', '', $id); + resolve_pageid(getNS($ID), $id, $exists, $this->date_at, true); - if (!$this->m_exclude && page_exists($id) && $id != $ID) { + if (!$this->m_exclude && $exists && $id != $ID) { $link = parent::internallink($fullId, $name, $search, true, $linktype); $meta = $this->m_helper->read_meta_fast($id);