resource="= $ebook->Url ?>" property="schema:hasPart" if($ebook->GetCollectionPosition($collection) !== null){ ?> value="= $ebook->GetCollectionPosition($collection) ?>" } ?> }else{ ?> about="= $ebook->Url ?>" } ?>>
@@ -21,19 +21,19 @@ $ebooks = $ebooks ?? [];
if($ebook->CoverImage2xAvifUrl !== null){ ?> } ?>
-
+
- = Formatter::ToPlainText($ebook->Title) ?>
+ = Formatter::EscapeHtml($ebook->Title) ?>
if($view == VIEW_GRID){ ?>
foreach($ebook->Authors as $author){ ?>
- if($author->Name != 'Anonymous'){ ?>= Formatter::ToPlainText($author->Name) ?> } ?>
+ if($author->Name != 'Anonymous'){ ?>= Formatter::EscapeHtml($author->Name) ?> } ?>
} ?>
}else{ ?>
@@ -43,7 +43,7 @@ $ebooks = $ebooks ?? [];
} ?>
= number_format($ebook->WordCount) ?> words • = $ebook->ReadingEase ?> reading ease
-
+
} ?>
diff --git a/templates/EmailAdminNewPatron.php b/templates/EmailAdminNewPatron.php
index 8f534d2d..b760e61d 100644
--- a/templates/EmailAdminNewPatron.php
+++ b/templates/EmailAdminNewPatron.php
@@ -17,7 +17,7 @@
Name: |
- if($patron->User->Name === null){ ?>Anonymous }else{ ?>= Formatter::ToPlainText($patron->User->Name) ?> if($patron->IsAnonymous){ ?> (Anonymous) } ?> } ?> |
+ if($patron->User->Name === null){ ?>Anonymous }else{ ?>= Formatter::EscapeHtml($patron->User->Name) ?> if($patron->IsAnonymous){ ?> (Anonymous) } ?> } ?> |
Donation type: |
@@ -25,15 +25,15 @@
Donation amount: |
- = Formatter::ToPlainText(number_format($payment->Amount, 2)) ?> |
+ = Formatter::EscapeHtml(number_format($payment->Amount, 2)) ?> |
Donation fee: |
- = Formatter::ToPlainText(number_format($payment->Fee, 2)) ?> |
+ = Formatter::EscapeHtml(number_format($payment->Fee, 2)) ?> |
Transaction ID: |
- = Formatter::ToPlainText($payment->TransactionId) ?> |
+ = Formatter::EscapeHtml($payment->TransactionId) ?> |
diff --git a/templates/EmailAdminNewPatronText.php b/templates/EmailAdminNewPatronText.php
index 5c73a45e..a1dfbb9f 100644
--- a/templates/EmailAdminNewPatronText.php
+++ b/templates/EmailAdminNewPatronText.php
@@ -1,9 +1,9 @@
-Name: if($patron->User->Name === null){ ?>Anonymous }else{ ?>= Formatter::ToPlainText($patron->User->Name) ?> if($patron->IsAnonymous){ ?> (Anonymous) } ?> } ?>
+Name: if($patron->User->Name === null){ ?>Anonymous }else{ ?>= Formatter::EscapeHtml($patron->User->Name) ?> if($patron->IsAnonymous){ ?> (Anonymous) } ?> } ?>
Donation type: if($payment->IsRecurring){ ?>Recurring }else{ ?>One-time } ?>
-Donation amount: = Formatter::ToPlainText(number_format($payment->Amount, 2)) ?>
+Donation amount: = Formatter::EscapeHtml(number_format($payment->Amount, 2)) ?>
-Donation fee: = Formatter::ToPlainText(number_format($payment->Fee, 2)) ?>
+Donation fee: = Formatter::EscapeHtml(number_format($payment->Fee, 2)) ?>
-Transaction ID: = Formatter::ToPlainText($payment->TransactionId) ?>
+Transaction ID: = Formatter::EscapeHtml($payment->TransactionId) ?>
diff --git a/templates/EmailHeader.php b/templates/EmailHeader.php
index c274a8f1..9c1936b3 100644
--- a/templates/EmailHeader.php
+++ b/templates/EmailHeader.php
@@ -191,4 +191,4 @@ $letterhead = $letterhead ?? false;
- if($preheader){ ?> } ?>
+ if($preheader){ ?> } ?>
diff --git a/templates/Error.php b/templates/Error.php
index 97e52ee0..d42376bf 100644
--- a/templates/Error.php
+++ b/templates/Error.php
@@ -16,7 +16,7 @@ else{
foreach($exceptions as $ex){ ?>
-
-
$message = $ex->getMessage(); if($message == ''){ $message = 'An error occurred.'; } ?>= str_replace('CAPTCHA', 'CAPTCHA', Formatter::ToPlainText($message)) ?>
+ $message = $ex->getMessage(); if($message == ''){ $message = 'An error occurred.'; } ?>= str_replace('CAPTCHA', 'CAPTCHA', Formatter::EscapeHtml($message)) ?>
} ?>
diff --git a/templates/Header.php b/templates/Header.php
index 7a556e06..ef5f2d33 100644
--- a/templates/Header.php
+++ b/templates/Header.php
@@ -29,8 +29,8 @@ if(!$isXslt){
/* The `og` RDFa prefix is part of the RDFa spec */ ?>
-
if($title != ''){ ?>= Formatter::ToPlainText($title) ?> - } ?>Standard Ebooks: Free and liberated ebooks, carefully produced for the true book lover.
- if($description != ''){ ?>
} ?>
+
if($title != ''){ ?>= Formatter::EscapeHtml($title) ?> - } ?>Standard Ebooks: Free and liberated ebooks, carefully produced for the true book lover.
+ if($description != ''){ ?>
} ?>
/* Fonts require the crossorigin attribute */ ?>
@@ -65,15 +65,15 @@ if(!$isXslt){
}else{ ?>
-
-
-
+
+
+
} ?>
if(!$isErrorPage){ ?>
-
+
diff --git a/templates/OpdsAcquisitionEntry.php b/templates/OpdsAcquisitionEntry.php
index ea840318..ede690f4 100644
--- a/templates/OpdsAcquisitionEntry.php
+++ b/templates/OpdsAcquisitionEntry.php
@@ -1,29 +1,29 @@
= SITE_URL . $entry->Url ?>
- = Formatter::ToPlainXmlText($entry->Identifier) ?>
- = Formatter::ToPlainXmlText($entry->Title) ?>
+ = Formatter::EscapeXml($entry->Identifier) ?>
+ = Formatter::EscapeXml($entry->Title) ?>
foreach($entry->Authors as $author){ ?>
- = Formatter::ToPlainXmlText($author->Name) ?>
- = SITE_URL . Formatter::ToPlainXmlText($entry->AuthorsUrl) ?>
- if($author->FullName !== null){ ?>= Formatter::ToPlainXmlText($author->FullName) ?> } ?>
- if($author->WikipediaUrl !== null){ ?>= Formatter::ToPlainXmlText($author->WikipediaUrl) ?> } ?>
- if($author->NacoafUrl !== null){ ?>= Formatter::ToPlainXmlText($author->NacoafUrl) ?> } ?>
+ = Formatter::EscapeXml($author->Name) ?>
+ = SITE_URL . Formatter::EscapeXml($entry->AuthorsUrl) ?>
+ if($author->FullName !== null){ ?>= Formatter::EscapeXml($author->FullName) ?> } ?>
+ if($author->WikipediaUrl !== null){ ?>= Formatter::EscapeXml($author->WikipediaUrl) ?> } ?>
+ if($author->NacoafUrl !== null){ ?>= Formatter::EscapeXml($author->NacoafUrl) ?> } ?>
} ?>
= $entry->Created->format('Y-m-d\TH:i:s\Z') ?>
= $entry->Created->format('Y-m-d\TH:i:s\Z') ?>
= $entry->Updated->format('Y-m-d\TH:i:s\Z') ?>
- = Formatter::ToPlainXmlText($entry->Language) ?>
+ = Formatter::EscapeXml($entry->Language) ?>
Standard Ebooks
Public domain in the United States. Users located outside of the United States must check their local laws before using this ebook. Original content released to the public domain via the Creative Commons CC0 1.0 Universal Public Domain Dedication.
- = Formatter::ToPlainXmlText($entry->Description) ?>
- = Formatter::ToPlainXmlText($entry->LongDescription) ?>
+ = Formatter::EscapeXml($entry->Description) ?>
+ = Formatter::EscapeXml($entry->LongDescription) ?>
foreach($entry->LocTags as $subject){ ?>
-
+
} ?>
foreach($entry->Tags as $subject){ ?>
-
+
} ?>
diff --git a/templates/OpdsAcquisitionFeed.php b/templates/OpdsAcquisitionFeed.php
index b51d8a3b..c2225c6a 100644
--- a/templates/OpdsAcquisitionFeed.php
+++ b/templates/OpdsAcquisitionFeed.php
@@ -17,14 +17,14 @@ $subtitle = $subtitle ?? null;
print("\n");
?>
xmlns:fh="http://purl.org/syndication/history/1.0" } ?>>
- = SITE_URL . Formatter::ToPlainXmlText($id) ?>
-
+ = SITE_URL . Formatter::EscapeXml($id) ?>
+
-
+
- = Formatter::ToPlainXmlText($title) ?>
- if($subtitle !== null){ ?>= Formatter::ToPlainXmlText($subtitle) ?> } ?>
+ = Formatter::EscapeXml($title) ?>
+ if($subtitle !== null){ ?>= Formatter::EscapeXml($subtitle) ?> } ?>
= SITE_URL ?>/images/logo.png
= $updated->format('Y-m-d\TH:i:s\Z') ?>
if($isCrawlable){ ?> } ?>
diff --git a/templates/OpdsNavigationFeed.php b/templates/OpdsNavigationFeed.php
index 9ac7fa37..0a4f4aa0 100644
--- a/templates/OpdsNavigationFeed.php
+++ b/templates/OpdsNavigationFeed.php
@@ -8,14 +8,14 @@ $subtitle = $subtitle ?? null;
print("\n");
?>
- = SITE_URL . Formatter::ToPlainXmlText($id) ?>
-
+ = SITE_URL . Formatter::EscapeXml($id) ?>
+
- if($parentUrl !== null){ ?> } ?>
- = Formatter::ToPlainXmlText($title) ?>
- if($subtitle !== null){ ?>= Formatter::ToPlainXmlText($subtitle) ?> } ?>
+ if($parentUrl !== null){ ?> } ?>
+ = Formatter::EscapeXml($title) ?>
+ if($subtitle !== null){ ?>= Formatter::EscapeXml($subtitle) ?> } ?>
= SITE_URL ?>/images/logo.png
= $updated->format('Y-m-d\TH:i:s\Z') ?>
@@ -24,11 +24,11 @@ print("\n");
foreach($entries as $entry){ ?>
- = Formatter::ToPlainXmlText($entry->Title) ?>
-
+ = Formatter::EscapeXml($entry->Title) ?>
+
if($entry->Updated !== null){ ?>= $entry->Updated->format('Y-m-d\TH:i:s\Z') ?> } ?>
- = Formatter::ToPlainXmlText($entry->Id) ?>
- = Formatter::ToPlainXmlText($entry->Description) ?>
+ = Formatter::EscapeXml($entry->Id) ?>
+ = Formatter::EscapeXml($entry->Description) ?>
} ?>
diff --git a/templates/RssEntry.php b/templates/RssEntry.php
index d47f9a6f..f6342973 100644
--- a/templates/RssEntry.php
+++ b/templates/RssEntry.php
@@ -1,14 +1,14 @@
-
- = Formatter::ToPlainXmlText($entry->Title) ?>, by = Formatter::ToPlainXmlText(strip_tags($entry->AuthorsHtml)) ?>
- = SITE_URL . Formatter::ToPlainXmlText($entry->Url) ?>
- = Formatter::ToPlainXmlText($entry->Description) ?>
+ = Formatter::EscapeXml($entry->Title) ?>, by = Formatter::EscapeXml(strip_tags($entry->AuthorsHtml)) ?>
+ = SITE_URL . Formatter::EscapeXml($entry->Url) ?>
+ = Formatter::EscapeXml($entry->Description) ?>
= $entry->Created->format('r') ?>
- = Formatter::ToPlainXmlText(preg_replace('/^url:/ius', '', $entry->Identifier)) ?>
+ = Formatter::EscapeXml(preg_replace('/^url:/ius', '', $entry->Identifier)) ?>
foreach($entry->Tags as $tag){ ?>
- = Formatter::ToPlainXmlText($tag->Name) ?>
+ = Formatter::EscapeXml($tag->Name) ?>
} ?>
if($entry->EpubUrl !== null){ ?>
- /* Only one is allowed */ ?>
+ /* Only one is allowed */ ?>
} ?>
diff --git a/templates/RssFeed.php b/templates/RssFeed.php
index b17d3e13..d4021aba 100644
--- a/templates/RssFeed.php
+++ b/templates/RssFeed.php
@@ -7,18 +7,18 @@ use Safe\DateTime;
print("\n");
?>
- = Formatter::ToPlainXmlText($title) ?>
+ = Formatter::EscapeXml($title) ?>
= SITE_URL ?>
- = Formatter::ToPlainXmlText($description) ?>
+ = Formatter::EscapeXml($description) ?>
en-US
https://creativecommons.org/publicdomain/zero/1.0/
= $updated ?>
http://blogs.law.harvard.edu/tech/rss
-
+
= SITE_URL ?>/images/logo-rss.png
- = Formatter::ToPlainXmlText($title) ?> /* must be identical to channel title */ ?>
+ = Formatter::EscapeXml($title) ?> /* must be identical to channel title */ ?>
The Standard Ebooks logo
= SITE_URL ?>
144
diff --git a/templates/SearchForm.php b/templates/SearchForm.php
index fa90d9cd..17ff29de 100644
--- a/templates/SearchForm.php
+++ b/templates/SearchForm.php
@@ -6,12 +6,12 @@ $allSelected = sizeof($tags) == 0 || in_array('all', $tags);