Disallow fetching from Wikidata disambiguation pages

Close #23
This commit is contained in:
2025-02-13 22:37:17 +01:00
parent 28f6db67ff
commit 9d7d53a858
3 changed files with 70 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
<?PHP
/**
* This file contains an exception class to be thrown if a user attempts to load
* data from a Wikidata item specifically established for a disambiguation page.
*
* @file
*
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
*/
declare(strict_types = 1);
/**
* Exception class to be thrown if a user attempts to load
* data from a Wikidata item specifically established for a disambiguation page.
*/
final class NodaWikidataFetcherDisambiguationIsDisallowedException extends MDgenericInvalidInputsException {
/**
* Error message.
*
* @return string
*/
public function errorMessage() {
//error message
return 'Attempted to load a disambiguation page. Please select the specific item you want to fetch to enrich the given entry: ' . $this->getMessage();
}
}