mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 10:31:59 -04:00
Add special 'query-ebook-url' parameter to /artworks to get covers matching exactly the ebook URL
This commit is contained in:
parent
3ebe6fe457
commit
801b5f524a
2 changed files with 9 additions and 2 deletions
|
@ -501,7 +501,7 @@ class Artwork extends PropertiesBase{
|
|||
// 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
|
||||
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.'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue