Skip to content

Commit

Permalink
Test toc_pdf_url, make creating link more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
xmorave2 committed May 22, 2024
1 parent b651a1b commit 4eacc2b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions module/VuFind/src/VuFind/Content/TOC/ObalkyKnih.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ public function loadByIsbn($key, \VuFindCode\ISBN $isbnObj)
];
$data = $this->service->getData($ids);
$toc = '';
if (isset($data->toc_thumbnail_url)) {
$toc = "<p><a href='" . htmlspecialchars($data->toc_pdf_url)
. "' target='_blank' ><img src='"
. htmlspecialchars($data->toc_thumbnail_url) . "'></a></p>";
if (isset($data->toc_thumbnail_url) && isset($data->toc_pdf_url)) {
$toc = '<p><a href="%s" target="_blank" ><img src="%s"></a></p>';
$toc = sprintf($toc, htmlspecialchars($data->toc_pdf_url), htmlspecialchars($data->toc_thumbnail_url));
}
return $toc;
}
Expand Down

0 comments on commit 4eacc2b

Please sign in to comment.