From d6006528f21d7812dc2e264163e905576eeb70ec Mon Sep 17 00:00:00 2001 From: Mike Colagrosso Date: Thu, 8 Feb 2024 23:56:07 -0700 Subject: [PATCH] Update the ebook URL validation error message --- lib/Artwork.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Artwork.php b/lib/Artwork.php index a8d23589..600cad9c 100644 --- a/lib/Artwork.php +++ b/lib/Artwork.php @@ -507,12 +507,12 @@ class Artwork extends PropertiesBase{ $error->Add(new Exceptions\MissingPdProofException()); } - // Check the ebook www filesystem path. + // Check the ebook URL. // We don't check if it exists, because the book might not be published yet. - // But we do a basic check that the string includes one _. It might not include a dash, for example anonymous_poetry + // But we do a basic check that URL has the correct prefix and that it contains a slash between the author(s) and title. if($this->EbookUrl !== null){ if(!preg_match('|^https://standardebooks.org/ebooks/[^/]+?/[^/]+?|ius', $this->EbookUrl)){ - $error->Add(new Exceptions\EbookNotFoundException('Invalid ebook. Expected S.E. URL.')); + $error->Add(new Exceptions\EbookNotFoundException('Invalid ebook URL. Check that it matches the URL in dc:identifier.')); } }