Skip to content

Commit

Permalink
Fix title ampersand bug
Browse files Browse the repository at this point in the history
The phpUnit test was failing. The title value returned was empty because the plugin is
expecting an extra ampersand that the test isn't providing.
  • Loading branch information
phillip-hopper committed Sep 2, 2015
1 parent 42a1cf6 commit 743904e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion syntax/exportlink.php
Expand Up @@ -59,7 +59,13 @@ public function handle($match, $state, $pos, Doku_Handler $handler) {
$ns = getNS($id);
$title = substr($match,strpos($match,'|')+1,-2);
$link = '?do=export_pdfns&book_ns=' . $ns . '&book_title=' . $title;
$title = substr($title,0,strpos($title,'&'));

// check if there is an ampersand in the title
$amp = strpos($title,'&');
if ($amp !== false) {
$title = substr($title,0,$amp);
}

return array('link' => $link, 'title' => sprintf($this->getLang('export_ns'),$ns,$title),$state, $pos);
}

Expand Down

0 comments on commit 743904e

Please sign in to comment.