mirror of
https://github.com/standardebooks/web.git
synced 2025-07-15 02:46:46 -04:00
Update the ebook URL validation error message
This commit is contained in:
parent
3f091b0aa8
commit
d6006528f2
1 changed files with 3 additions and 3 deletions
|
@ -507,12 +507,12 @@ class Artwork extends PropertiesBase{
|
||||||
$error->Add(new Exceptions\MissingPdProofException());
|
$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.
|
// 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($this->EbookUrl !== null){
|
||||||
if(!preg_match('|^https://standardebooks.org/ebooks/[^/]+?/[^/]+?|ius', $this->EbookUrl)){
|
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.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue