Skip to content
Snippets Groups Projects
Commit 44653a53 authored by Adrian Lang's avatar Adrian Lang
Browse files

Allow URL params in internal links (FS#1967)

parent a0070b52
No related branches found
No related tags found
No related merge requests found
...@@ -559,6 +559,18 @@ class Doku_Renderer_xhtml extends Doku_Renderer { ...@@ -559,6 +559,18 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
function internallink($id, $name = NULL, $search=NULL,$returnonly=false,$linktype='content') { function internallink($id, $name = NULL, $search=NULL,$returnonly=false,$linktype='content') {
global $conf; global $conf;
global $ID; global $ID;
$params = array();
if (preg_match('/^([^?]*)\?([^?]+)$/', $id, $matches) !== false) {
$id = $matches[1];
preg_match_all('/(?<=[&^])([^=]+)=([^=]*)(?:&|$)/', $matches[2],
$matches, PREG_SET_ORDER);
foreach($matches as &$param) {
$params[$param[1]] = $param[2];
}
}
// default name is based on $id as given // default name is based on $id as given
$default = $this->_simpleTitle($id); $default = $this->_simpleTitle($id);
...@@ -592,7 +604,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { ...@@ -592,7 +604,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
} }
$link['more'] = ''; $link['more'] = '';
$link['class'] = $class; $link['class'] = $class;
$link['url'] = wl($id); $link['url'] = wl($id, $params);
$link['name'] = $name; $link['name'] = $name;
$link['title'] = $id; $link['title'] = $id;
//add search string //add search string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment