mirror of
https://github.com/standardebooks/web.git
synced 2025-07-21 06:45:14 -04:00
Escape transcriptoin URLs in Wanted Ebooks page
This commit is contained in:
parent
38400991c2
commit
9c15cd2c1f
2 changed files with 2 additions and 2 deletions
|
@ -83,7 +83,7 @@ class Formatter{
|
|||
}
|
||||
|
||||
/**
|
||||
* Escape a strin so that it's safe to output directly into an XML document. Note that this is **not the same** as escaping for HTML. Any query strings in URLs should already be URL-encoded, for example `?foo=bar+baz&x=y`.
|
||||
* Escape a string so that it's safe to output directly into an XML document. Note that this is **not the same** as escaping for HTML. Any query strings in URLs should already be URL-encoded, for example `?foo=bar+baz&x=y`.
|
||||
*/
|
||||
public static function EscapeXml(?string $text): string{
|
||||
return htmlspecialchars(trim($text ?? ''), ENT_QUOTES|ENT_XML1, 'utf-8');
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<? foreach($ebooks as $ebook){ ?>
|
||||
<li>
|
||||
<p>
|
||||
<? if(isset($ebook->EbookPlaceholder->TranscriptionUrl)){ ?><a href="<?= $ebook->EbookPlaceholder->TranscriptionUrl ?>"><? } ?><i><?= Formatter::EscapeHtml($ebook->Title) ?></i><? if(isset($ebook->EbookPlaceholder->TranscriptionUrl)){ ?></a><? } ?>
|
||||
<? if(isset($ebook->EbookPlaceholder->TranscriptionUrl)){ ?><a href="<?= Formatter::EscapeHtml($ebook->EbookPlaceholder->TranscriptionUrl) ?>"><? } ?><i><?= Formatter::EscapeHtml($ebook->Title) ?></i><? if(isset($ebook->EbookPlaceholder->TranscriptionUrl)){ ?></a><? } ?>
|
||||
|
||||
|
||||
by <?= Formatter::EscapeHtml($ebook->AuthorsString) ?>. <?= $ebook->ContributorsHtml ?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue