mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 10:02:02 -04:00
Parse URL when checking for approved museums
This commit is contained in:
parent
60eb118524
commit
57ed9c5c1e
2 changed files with 10 additions and 3 deletions
|
@ -9,12 +9,19 @@ class Museum extends PropertiesBase{
|
|||
throw new Exceptions\MuseumNotFoundException();
|
||||
}
|
||||
|
||||
try{
|
||||
$parsedUrl = parse_url($url);
|
||||
}
|
||||
catch(Exception){
|
||||
throw new Exceptions\InvalidUrlException($url);
|
||||
}
|
||||
|
||||
$result = Db::Query('
|
||||
SELECT *
|
||||
from Museums
|
||||
where ? like concat("%", Domain, "%")
|
||||
limit 1;
|
||||
', [$url], 'Museum');
|
||||
', [$parsedUrl['host']], 'Museum');
|
||||
|
||||
if(sizeof($result) == 0){
|
||||
throw new Exceptions\MuseumNotFoundException();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue