diff options
author | Adrian Lang <lang@cosmocode.de> | 2010-06-17 15:43:30 +0200 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2010-06-17 15:44:07 +0200 |
commit | 44653a53fe7db9e1c14e4a1d1034cf63787139b3 (patch) | |
tree | afb64b89cec34d1673a2c2d5b61b41fee07f096a /inc/parser | |
parent | a0070b52bbd24f6972b819fa8ff4bdbfe81b5bbc (diff) | |
download | rpg-44653a53fe7db9e1c14e4a1d1034cf63787139b3.tar.gz rpg-44653a53fe7db9e1c14e4a1d1034cf63787139b3.tar.bz2 |
Allow URL params in internal links (FS#1967)
Diffstat (limited to 'inc/parser')
-rw-r--r-- | inc/parser/xhtml.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 176411c75..0ee04e5a1 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -559,6 +559,18 @@ class Doku_Renderer_xhtml extends Doku_Renderer { function internallink($id, $name = NULL, $search=NULL,$returnonly=false,$linktype='content') { global $conf; 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 = $this->_simpleTitle($id); @@ -592,7 +604,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } $link['more'] = ''; $link['class'] = $class; - $link['url'] = wl($id); + $link['url'] = wl($id, $params); $link['name'] = $name; $link['title'] = $id; //add search string |