Skip to content

Commit

Permalink
Prevent E_NOTICE
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX authored and yunosh committed Sep 1, 2017
1 parent 076d0bd commit 16cc24f
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions Text/Wiki/Render/Doku/Url.php
Expand Up @@ -18,27 +18,35 @@ class Text_Wiki_Render_Doku_Url extends Text_Wiki_Render {

function token($options)
{
$page_text_options = false;
if (isset($options['page']) && isset($options['text'])) {
$page_text_options = $options['page'] == $options['text'];
} elseif (empty($options['page']) && empty($options['text'])) {
$page_text_options = true;
}


if ($options['type'] == 'start') {
if (! strlen($options['text']) || $options['page'] == $options['text']) {
if (!strlen($options['text']) || $page_text_options) {
return $options['href'];
} else {
return '[['.$options['href'].'|';
}
}
else if ($options['type'] == 'end') {
if (! strlen($options['text']) || $options['page'] == $options['text']) {
if (! strlen($options['text']) || $page_text_options) {
return '';
} else {
return ']]';
}
}
else {
if (! strlen($options['text']) || $options['page'] == $options['text']) {
if (! strlen($options['text']) || $page_text_options) {
return $options['href'];
} else {
return '[['.$options['href'].'|'.$options['text'].']]';
}
}
}
}
?>
?>

0 comments on commit 16cc24f

Please sign in to comment.